Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of HTTPClient by
Diff: HTTPClient.h
- Revision:
- 19:bcbf0af9fac3
- Parent:
- 18:cf5d7427a9ec
- Child:
- 20:4ea5255c1b04
diff -r cf5d7427a9ec -r bcbf0af9fac3 HTTPClient.h --- a/HTTPClient.h Sun Apr 28 10:04:51 2013 +0000 +++ b/HTTPClient.h Fri Jan 24 13:51:36 2014 +0000 @@ -61,7 +61,6 @@ HTTPClient(); ~HTTPClient(); -#if 1 //TODO add header handlers /** Provides a basic authentification feature (Base64 encoded username and password) Pass two NULL pointers to switch back to no authentication @@ -69,7 +68,14 @@ @param user password to use for authentication, must remain valid durlng the whole HTTP session */ void basicAuth(const char* user, const char* password); //Basic Authentification -#endif + + /** + Set custom headers for request. + Pass NULL, 0 to turn off custom headers. + @param headers an array (size multiple of two) key-value pairs, must remain valid during the whole HTTP session + @param pairs number of key-value pairs + */ + void customHeaders(const char** headers, size_t pairs); //High Level setup functions /** Execute a GET request on the URL @@ -150,6 +156,8 @@ const char* m_basicAuthUser; const char* m_basicAuthPassword; + const char** m_customHeaders; + size_t m_nCustomHeaders; int m_httpResponseCode; };
