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:
43:12a6ae712bcd
Parent:
42:ab259a9d1d36
Child:
44:0e3b0849b2c7
--- a/data/HTTPiCal.cpp	Sun Jun 04 15:51:38 2017 +0000
+++ b/data/HTTPiCal.cpp	Thu Jul 20 10:56:03 2017 +0000
@@ -192,12 +192,16 @@
     return tStamp;
 }
 
+// since this returns the string from a static buffer, and unknowing users
+// might call this twice in a single command (e.g. printf(..., FormatCTime(time1), FormatCTime(time2));
+// this define controls how many of these can execute.
+#define NumCallsPerArgList 2
 char * HTTPiCal::FormatCTime(time_t t)
 {
-    static char temp[4][80];
+    static char temp[NumCallsPerArgList][80];
     static int i = 0;
 
-    i &= 3;
+    i %= NumCallsPerArgList;
     strcpy(temp[i], ctime(&t));
     temp[i][strlen(temp[i])-1] = '\0';
     return temp[i++];