Beispiel fuer Verwendung der HTTP Methoden (GET, POST, PUT, DELETE)

Dependencies:   EthernetInterface mbed-rtos mbed

Fork of Sample_HTTPClient by David Smart

Files at this revision

API Documentation at this revision

Comitter:
marcel1691
Date:
Mon Jan 19 10:39:52 2015 +0000
Parent:
1:2e29a33cd918
Commit message:
Korrektur key/value Laengen beim lesen Request

Changed in this revision

HTTPClient/HTTPClient.cpp Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/HTTPClient/HTTPClient.cpp	Sat Jan 17 14:11:01 2015 +0000
+++ b/HTTPClient/HTTPClient.cpp	Mon Jan 19 10:39:52 2015 +0000
@@ -360,13 +360,13 @@
 
             buf[crlfPos] = '\0';
 
-            char key[32];
+            char key[36];
             char value[MAXLEN_VALUE];
 
-            key[31] = '\0';
+            key[35] = '\0';
             value[MAXLEN_VALUE - 1] = '\0';
 
-            int n = sscanf(buf, "%35[^:]: %156[^\r\n]", key, value);
+            int n = sscanf(buf, "%35[^:]: %119[^\r\n]", key, value);
             if ( n == 2 ) {
                 DBG("Read header : %s: %s", key, value);
                 if( !strcmp(key, "Content-Length") ) {
--- a/main.cpp	Sat Jan 17 14:11:01 2015 +0000
+++ b/main.cpp	Mon Jan 19 10:39:52 2015 +0000
@@ -81,7 +81,6 @@
         }
 
         wait(10);
-        break;
     }
     // eth.disconnect();
 }