userver
C++ Async Framework
Loading...
Searching...
No Matches
json_data.hpp
Go to the documentation of this file.
1
#
pragma
once
2
3
/// @file userver/server/request/json_data.hpp
4
/// @brief Functions that handle JSON requests and responses stored in context.
5
6
#
include
<
userver
/
formats
/
json
/
value
.
hpp
>
7
#
include
<
userver
/
server
/
request
/
request_context
.
hpp
>
8
9
USERVER_NAMESPACE_BEGIN
10
11
namespace
server::
request
{
12
13
/// @returns A pointer to json request if it was parsed successfully and stored in the context or
14
/// nullptr otherwise.
15
const
formats
::
json
::
Value
*
GetRequestJson
(
const
RequestContext& context);
16
17
/// @brief Saves a parsed json request to the context.
18
/// @returns A reference to the saved json.
19
formats
::
json
::
Value
&
SetRequestJson
(RequestContext& context,
formats
::
json
::
Value
request_json);
20
21
/// @returns A pointer to json response if it was produced successfully and stored in the context
22
/// or nullptr otherwise.
23
const
formats
::
json
::
Value
*
GetResponseJson
(
const
RequestContext& context);
24
25
/// @brief Saves a json response to the context.
26
/// @returns A reference to the saved json.
27
formats
::
json
::
Value
&
SetResponseJson
(RequestContext& context,
formats
::
json
::
Value
request_json);
28
29
}
// namespace server::request
30
31
USERVER_NAMESPACE_END
userver
server
request
json_data.hpp
Generated on Tue Jan 27 2026 16:45:54 for userver by
Doxygen
1.13.2