diff options
author | Jaeseung Ha <ipknhama@gmail.com> | 2017-10-21 20:51:35 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-21 20:51:35 +0900 |
commit | 7f3f72441c242836d00ab2109a83baef89c08aaa (patch) | |
tree | 0598733459893098dd478e80327b047aa06095f9 /include | |
parent | 53af5043ac6f77cb8580c13b50956bf97819eb69 (diff) | |
parent | 8b01385465a2a1366ca2a62a99211140a9c62fa2 (diff) | |
download | crow-7f3f72441c242836d00ab2109a83baef89c08aaa.tar.gz crow-7f3f72441c242836d00ab2109a83baef89c08aaa.zip |
Merge pull request #253 from boodkb/patch_method
Add support for HTTP PATCH method
Diffstat (limited to 'include')
-rw-r--r-- | include/crow/common.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/crow/common.h b/include/crow/common.h index 84d1361..ac6e789 100644 --- a/include/crow/common.h +++ b/include/crow/common.h @@ -19,6 +19,7 @@ namespace crow CONNECT, OPTIONS, TRACE, + PATCH = 24, #endif Delete = 0, @@ -29,6 +30,7 @@ namespace crow Connect, Options, Trace, + Patch = 24, }; inline std::string method_name(HTTPMethod method) @@ -51,6 +53,8 @@ namespace crow return "OPTIONS"; case HTTPMethod::Trace: return "TRACE"; + case HTTPMethod::Patch: + return "PATCH"; } return "invalid"; } @@ -132,6 +136,7 @@ constexpr crow::HTTPMethod operator "" _method(const char* str, size_t /*len*/) crow::black_magic::is_equ_p(str, "OPTIONS", 7) ? crow::HTTPMethod::Options : crow::black_magic::is_equ_p(str, "CONNECT", 7) ? crow::HTTPMethod::Connect : crow::black_magic::is_equ_p(str, "TRACE", 5) ? crow::HTTPMethod::Trace : + crow::black_magic::is_equ_p(str, "PATCH", 5) ? crow::HTTPMethod::Patch : throw std::runtime_error("invalid http method"); } #endif |