Upper Version Add PUT method Delete POST method

Dependencies:   Adafruit_GFX MbedJSONValue_v102 WIZnetInterface mbed

Fork of WIZwiki-REST-io_v102 by Lawrence Lee

Revision:
2:ca36ecca24c2
Parent:
0:5886f525a4ad
Child:
4:0b5a199e91f3
diff -r 728e5b5c8dae -r ca36ecca24c2 HTTPServer.cpp
--- 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;
             }
         }