userver
C++ Async Framework
Toggle main menu visibility
Loading...
Searching...
No Matches
http_handler_json_base.hpp
Go to the documentation of this file.
1
#pragma once
2
5
6
#include <
userver/server/handlers/http_handler_base.hpp
>
7
8
USERVER_NAMESPACE_BEGIN
9
10
namespace
server::handlers
{
11
20
class
HttpHandlerJsonBase :
public
HttpHandlerBase {
21
public
:
22
using
Value =
formats::json::Value
;
23
using
HttpRequest =
server::http::HttpRequest
;
24
using
RequestContext =
server::request::RequestContext
;
25
26
HttpHandlerJsonBase(
27
const
components::ComponentConfig
& config,
28
const
components::ComponentContext
& component_context,
29
bool
is_monitor =
false
30
);
31
32
std::string
HandleRequestThrow
(
const
http::HttpRequest
&
request
,
request::RequestContext
& context)
const
final
;
33
34
virtual
Value HandleRequestJsonThrow(
const
HttpRequest&
request
,
const
Value& request_json, RequestContext& context)
35
const
= 0;
36
37
static
yaml_config::Schema
GetStaticConfigSchema
();
38
39
protected
:
40
void
ParseRequestData
(
const
http::HttpRequest
&
request
,
request::RequestContext
& context)
const override
;
41
42
private
:
43
FormattedErrorData
GetFormattedExternalErrorBody(
const
CustomHandlerException
& exc)
const
final
;
44
};
45
46
}
// namespace server::handlers
47
48
template
<>
49
inline
constexpr
bool
components::kHasValidate<server::handlers::HttpHandlerJsonBase>
=
true
;
50
51
USERVER_NAMESPACE_END
userver
server
handlers
http_handler_json_base.hpp
Generated on
for userver by
Doxygen
1.17.0