User Manual
AdafruitHTTP
AdafruitHTTP helps make working with HTTP requests easier, including HTTPS based servers with TLS certificates.
It includes convenient callbacks for incoming data, as well as helper functions to deal with HTTP response headers,
response codes, and other HTTP specific details.
AdafruitHTTP API
The AdafruitHTTP class has the following public functions:
HTTP Headers
The follow functions are provided as helpers working with 'header' entries in your HTTP requests.
bool addHeader (const char* name, const char* value)
Adds a new header name/value pair to the HTTP request.
Parameters:
name: A null-terminated string representing the 'name' in the header name/value pair.
value: A null-terminated string representing the 'value' in the name/value pair.
Returns: 'True' (1) if the header was successfully added, otherwise 'false' (0).
bool clearHeaders (void)
Clears all user-defined headers in the pending HTTP request.
Parameters: None
Returns: 'True' (1) if the headers were successfully cleared, otherwise 'false' (0).
HTTP GET Requests
bool addHeader ( const char* name, const char* value );
bool clearHeaders ( void );
bool get ( char const *url );
bool get ( char const * host, char const *url );
bool post ( char const *url, char const* encoded_data );
bool post ( char const * host, char const *url, char const* encoded_data );
Up to ten (10) header name/value pairs can be inserted into your HTTP request.
// Setup the HTTP request with any required header entries
http.addHeader("User-Agent", "curl/7.45.0"); // Simulate curl
http.addHeader("Accept", "text/html");
http.addHeader("Connection", "keep-alive");
© Adafruit Industries https://learn.adafruit.com/introducing-the-adafruit-wiced-feather-wifi Page 94 of 202










