Fixed custom headers and Basic authorization, added support for redirection, functional file download interface can be used for SW updates and more.

Dependents:   Sample_HTTPClient Sample_HTTPClient LWM2M_NanoService_Ethernet LWM2M_NanoService_Ethernet ... more

Fork of HTTPClient by Vincent Wochnik

More recent changes - added iCal processing.

Derivative of a derivative, however this one works when it comes to supplying Basic authorization to access a protected resource. Some additional changes to the debug interface to clean it up for consistency with many other components I have.

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;
 
 };