瀏覽代碼

DELETE => Delete

ithewei 5 年之前
父節點
當前提交
cac8ed0b5b
共有 2 個文件被更改,包括 3 次插入2 次删除
  1. 1 1
      examples/httpd/router.h
  2. 2 1
      http/server/HttpService.h

+ 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);
     }