![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
WIZwiki-REST-io ver.2 Add POST Method
Dependencies: MbedJSONValue_copy WIZnetInterface mbed
Fork of WIZwiki-REST_mc by
Diff: HTTPServer.cpp
- Revision:
- 2:ca36ecca24c2
- Parent:
- 0:5886f525a4ad
- Child:
- 4:0b5a199e91f3
--- a/HTTPServer.cpp Tue Apr 05 11:40:33 2016 +0000 +++ b/HTTPServer.cpp Tue May 03 02:15:59 2016 +0000 @@ -60,7 +60,9 @@ } else if(n != -1) { +#ifdef DEBUG_HTTP printf("Received data : %d\r\n",n); +#endif HTTPBUF[n] = '\0'; if(handle_request(HTTPBUF) == HTTP_SUCCESS) @@ -90,26 +92,33 @@ //{"Name":"WIZwiki-REST-01","Network":{"IP":"192.168.100.100","SN":"255.255.255.0","GW":"192.168.100.1"},"User":{"Name":"Lawrence","ID":"law","PSWD":"law1234"}} 159 if(buffer) { +#ifdef DEBUG_HTTP // buffer check printf("*******************************************************\r\n"); printf("buffer=%s\r\n",buffer); printf("*******************************************************\r\n"); - +#endif // type parsing request_type = strtok(buffer," \r\n"); +#ifdef DEBUG_HTTP printf("Type = %s\r\n", request_type); +#endif if(request_type) { request = strtok(NULL, " \r\n"); // corrested " " -> " /" : /Name -> Name if(request) { +#ifdef DEBUG_HTTP printf("URI = %s\r\n", request); +#endif } else { strcpy(rest_result, "Invaild URI"); +#ifdef DEBUG_HTTP printf("%s\r\n",rest_result); +#endif return HTTP_INVALID_URI; } }