Fork of the working HTTPClient adaptation using CyaSSL. This version adds a derivation of HTTPText called HTTPJson to emit JSON text properly. Additionally, the URL parser has defines that permit longer URLs to be utilized.

Dependencies:   mbedTLSLibrary

Dependents:   SalesforceInterface df-2014-heroku-thermostat-k64f SalesforceInterface

Fork of HTTPClient by wolf SSL

This is a fork of the working HTTPS/SSL library that contains two extensions:

- HTTPJson - a derivation of HTTPText for emitting JSON strings specifically. No JSON parsing/checking is accomplished - HTTPJson simply sets the right Content-Type for HTTP(S).

- Expanded internal buffers for longer URLs. This is set in HTTPClient.cpp and is tunable.

Revision:
52:cea1021a822d
Parent:
51:3bdf57f7fd60
Child:
53:fa91a40cecb5
--- a/HTTPClient.cpp	Thu Aug 20 18:55:41 2015 +0000
+++ b/HTTPClient.cpp	Wed Oct 28 03:47:56 2015 +0000
@@ -575,17 +575,17 @@
         int n = sscanf(buf, HEADER_SCANF_FORMAT, key, value);
         if ( n == 2 ) {
             DBG("Read header : %s: %s\n", key, value);
-            if( !strcmp(key, "Content-Length") ) {
+            if( !strcmp(key, "Content-Length") || !strcmp(key, "content-length")) {
                 sscanf(value, "%d", &recvContentLength);
                 pDataIn->setDataLen(recvContentLength);
-            } else if( !strcmp(key, "Transfer-Encoding") ) {
+            } else if( !strcmp(key, "Transfer-Encoding") || !strcmp(key, "transfer-encoding")) {
                 if( !strcmp(value, "Chunked") || !strcmp(value, "chunked") ) {
                     recvChunked = true;
                     pDataIn->setIsChunked(true);
                 }
-            } else if( !strcmp(key, "Content-Type") ) {
+            } else if( !strcmp(key, "Content-Type") || !strcmp(key, "content-type") ) {
                 pDataIn->setDataType(value);
-            } else if( !strcmp(key, "Location") && redirect_url) {      // Location is capitalized...
+            } else if( (!strcmp(key, "Location") || !strcmp(key, "location") )&& redirect_url) {    
                 sscanf(buf, REDIRECT_SCANF_FORMAT, key, redirect_url);
                 DBG("Redirect %s: %s", key, redirect_url) ;
                 redirect = 1 ;