userver
C++ Async Framework
Toggle main menu visibility
Loading...
Searching...
No Matches
http_method.hpp
Go to the documentation of this file.
1
#pragma once
2
5
6
#include <string>
7
8
#include <fmt/core.h>
9
#include <
userver/formats/parse/to.hpp
>
10
#include <
userver/utils/fmt_compat.hpp
>
11
12
USERVER_NAMESPACE_BEGIN
13
14
namespace
yaml_config
{
15
class
YamlConfig
;
16
}
17
18
namespace
server::http
{
19
21
enum class
HttpMethod
{
22
kDelete,
23
kGet,
24
kHead,
25
kPost,
26
kPut,
27
kPatch,
28
kConnect,
29
kOptions,
30
kUnknown,
31
};
32
34
const
std::string&
ToString
(
HttpMethod
method)
noexcept
;
35
37
HttpMethod
HttpMethodFromString
(std::string_view method_str);
38
39
HttpMethod
Parse(
const
yaml_config::YamlConfig
& value,
formats::parse::To<HttpMethod>
);
40
41
}
// namespace server::http
42
43
USERVER_NAMESPACE_END
44
45
template
<>
46
struct
fmt::formatter<USERVER_NAMESPACE::
server::http::HttpMethod
> {
47
constexpr
static
auto
parse(format_parse_context& ctx) {
return
ctx.begin(); }
48
49
template
<
typename
FormatContext>
50
auto
format(USERVER_NAMESPACE::server::http::HttpMethod method, FormatContext& ctx) USERVER_FMT_CONST {
51
return
fmt::format_to(ctx.out(),
"{}"
, USERVER_NAMESPACE::server::http::ToString(method));
52
}
53
};
userver
server
http
http_method.hpp
Generated on
for userver by
Doxygen
1.17.0