Fork HTTPClient and Modfiy code for mbed 6.0

Dependents:   mbed-demo-http-get-json

Revision:
19:bcbf0af9fac3
Parent:
18:cf5d7427a9ec
Child:
20:4ea5255c1b04
--- 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;
 
 };