1
0
ithewei 5 жил өмнө
parent
commit
cac8ed0b5b

+ 1 - 1
examples/httpd/router.h

@@ -51,7 +51,7 @@ public:
 
         // RESTful API: /group/:group_name/user/:user_id
         // curl -v -X DELETE http://ip:port/group/test/user/123
-        http.DELETE("/group/:group_name/user/:user_id", Handler::restful);
+        http.Delete("/group/:group_name/user/:user_id", Handler::restful);
 
         // bin/curl -v localhost:8080/upload -F "file=@LICENSE"
         http.POST("/upload", Handler::upload);

+ 2 - 1
http/server/HttpService.h

@@ -83,7 +83,8 @@ struct HV_EXPORT HttpService {
         Handle("PUT", relativePath, handlerFunc);
     }
 
-    void DELETE(const char* relativePath, http_api_handler handlerFunc) {
+    // NOTE: Windows <winnt.h> #define DELETE as a macro, we have to replace DELETE with Delete.
+    void Delete(const char* relativePath, http_api_handler handlerFunc) {
         Handle("DELETE", relativePath, handlerFunc);
     }