libpromeki 1.0.0-alpha
PROfessional MEdia toolKIt
 
Loading...
Searching...
No Matches
httpmethod.h
Go to the documentation of this file.
1
8#pragma once
9
10
11#include <promeki/config.h>
12#if PROMEKI_ENABLE_HTTP
13#include <promeki/namespace.h>
14#include <promeki/enum.h>
15#include <promeki/string.h>
16
17PROMEKI_NAMESPACE_BEGIN
18
39class HttpMethod : public TypedEnum<HttpMethod> {
40 public:
41 PROMEKI_REGISTER_ENUM_TYPE("HttpMethod", 0, {"GET", 0}, {"HEAD", 1}, {"POST", 2}, {"PUT", 3},
42 {"DELETE", 4}, {"PATCH", 5}, {"OPTIONS", 6}, {"CONNECT", 7}, {"TRACE", 8});
43
44 using TypedEnum<HttpMethod>::TypedEnum;
45
46 static const HttpMethod Get;
47 static const HttpMethod Head;
48 static const HttpMethod Post;
49 static const HttpMethod Put;
50 static const HttpMethod Delete;
51 static const HttpMethod Patch;
52 static const HttpMethod Options;
53 static const HttpMethod Connect;
54 static const HttpMethod Trace;
55
64 String wireName() const;
65
74 bool allowsBody() const;
75};
76
77inline const HttpMethod HttpMethod::Get{0};
78inline const HttpMethod HttpMethod::Head{1};
79inline const HttpMethod HttpMethod::Post{2};
80inline const HttpMethod HttpMethod::Put{3};
81inline const HttpMethod HttpMethod::Delete{4};
82inline const HttpMethod HttpMethod::Patch{5};
83inline const HttpMethod HttpMethod::Options{6};
84inline const HttpMethod HttpMethod::Connect{7};
85inline const HttpMethod HttpMethod::Trace{8};
86
87PROMEKI_NAMESPACE_END
88
89#endif // PROMEKI_ENABLE_HTTP