#include <userver/server/http/http_request.hpp>
HTTP Request data.
Definition at line 37 of file http_request.hpp.
Public Types | |
using | HeadersMap = ::http::headers::HeaderMap |
using | HeadersMapKeys = decltype(utils::impl::MakeKeysView(HeadersMap())) |
using | CookiesMap |
using | CookiesMapKeys = decltype(utils::impl::MakeKeysView(CookiesMap())) |
Public Member Functions | |
HttpResponse & | GetHttpResponse () const |
Returns a container that should be filled with response data to this request. | |
const HttpMethod & | GetMethod () const |
const std::string & | GetMethodStr () const |
int | GetHttpMajor () const |
int | GetHttpMinor () const |
const std::string & | GetUrl () const |
const std::string & | GetRequestPath () const |
const std::string & | GetPathSuffix () const |
std::chrono::duration< double > | GetRequestTime () const |
std::chrono::duration< double > | GetResponseTime () const |
const std::string & | GetHost () const |
const std::string & | GetArg (std::string_view arg_name) const |
const std::vector< std::string > & | GetArgVector (std::string_view arg_name) const |
bool | HasArg (std::string_view arg_name) const |
size_t | ArgCount () const |
std::vector< std::string > | ArgNames () const |
const FormDataArg & | GetFormDataArg (std::string_view arg_name) const |
const std::vector< FormDataArg > & | GetFormDataArgVector (std::string_view arg_name) const |
bool | HasFormDataArg (std::string_view arg_name) const |
size_t | FormDataArgCount () const |
std::vector< std::string > | FormDataArgNames () const |
const std::string & | GetPathArg (std::string_view arg_name) const |
const std::string & | GetPathArg (size_t index) const |
bool | HasPathArg (std::string_view arg_name) const |
bool | HasPathArg (size_t index) const |
size_t | PathArgCount () const |
const std::string & | GetHeader (std::string_view header_name) const |
const std::string & | GetHeader (const ::http::headers::PredefinedHeader &header_name) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
const HeadersMap & | GetHeaders () const |
bool | HasHeader (std::string_view header_name) const |
bool | HasHeader (const ::http::headers::PredefinedHeader &header_name) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
size_t | HeaderCount () const |
HeadersMapKeys | GetHeaderNames () const |
void | RemoveHeader (std::string_view header_name) |
Removes the header with case insensitive name header_name. | |
void | RemoveHeader (const ::http::headers::PredefinedHeader &header_name) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
const std::string & | GetCookie (const std::string &cookie_name) const |
bool | HasCookie (const std::string &cookie_name) const |
size_t | CookieCount () const |
CookiesMapKeys | GetCookieNames () const |
const std::string & | RequestBody () const |
const HeadersMap & | RequestHeaders () const |
const CookiesMap & | RequestCookies () const |
void | SetResponseStatus (HttpStatus status) const |
Set the response status code. | |
bool | IsBodyCompressed () const |
using server::http::HttpRequest::CookiesMap |
Definition at line 43 of file http_request.hpp.
using server::http::HttpRequest::CookiesMapKeys = decltype(utils::impl::MakeKeysView(CookiesMap())) |
Definition at line 46 of file http_request.hpp.
Definition at line 39 of file http_request.hpp.
using server::http::HttpRequest::HeadersMapKeys = decltype(utils::impl::MakeKeysView(HeadersMap())) |
Definition at line 41 of file http_request.hpp.
size_t server::http::HttpRequest::ArgCount | ( | ) | const |
parse_args_from_body: true
for handler is set). std::vector< std::string > server::http::HttpRequest::ArgNames | ( | ) | const |
parse_args_from_body: true
for handler is set). size_t server::http::HttpRequest::CookieCount | ( | ) | const |
size_t server::http::HttpRequest::FormDataArgCount | ( | ) | const |
std::vector< std::string > server::http::HttpRequest::FormDataArgNames | ( | ) | const |
const std::string & server::http::HttpRequest::GetArg | ( | std::string_view | arg_name | ) | const |
arg_name
or an empty string if no such argument. Arguments are extracted from:parse_args_from_body: true
for handler is set). const std::vector< std::string > & server::http::HttpRequest::GetArgVector | ( | std::string_view | arg_name | ) | const |
arg_name
or an empty vector if no such argument. Arguments are extracted from:parse_args_from_body: true
for handler is set). const std::string & server::http::HttpRequest::GetCookie | ( | const std::string & | cookie_name | ) | const |
CookiesMapKeys server::http::HttpRequest::GetCookieNames | ( | ) | const |
const FormDataArg & server::http::HttpRequest::GetFormDataArg | ( | std::string_view | arg_name | ) | const |
const std::vector< FormDataArg > & server::http::HttpRequest::GetFormDataArgVector | ( | std::string_view | arg_name | ) | const |
const std::string & server::http::HttpRequest::GetHeader | ( | std::string_view | header_name | ) | const |
HeadersMapKeys server::http::HttpRequest::GetHeaderNames | ( | ) | const |
const std::string & server::http::HttpRequest::GetHost | ( | ) | const |
int server::http::HttpRequest::GetHttpMajor | ( | ) | const |
int server::http::HttpRequest::GetHttpMinor | ( | ) | const |
const std::string & server::http::HttpRequest::GetPathArg | ( | size_t | index | ) | const |
const std::string & server::http::HttpRequest::GetPathArg | ( | std::string_view | arg_name | ) | const |
const std::string & server::http::HttpRequest::GetPathSuffix | ( | ) | const |
const std::string & server::http::HttpRequest::GetRequestPath | ( | ) | const |
const std::string & server::http::HttpRequest::GetUrl | ( | ) | const |
bool server::http::HttpRequest::HasArg | ( | std::string_view | arg_name | ) | const |
parse_args_from_body: true
for handler is set). bool server::http::HttpRequest::HasCookie | ( | const std::string & | cookie_name | ) | const |
bool server::http::HttpRequest::HasFormDataArg | ( | std::string_view | arg_name | ) | const |
bool server::http::HttpRequest::HasHeader | ( | std::string_view | header_name | ) | const |
bool server::http::HttpRequest::HasPathArg | ( | size_t | index | ) | const |
bool server::http::HttpRequest::HasPathArg | ( | std::string_view | arg_name | ) | const |
size_t server::http::HttpRequest::HeaderCount | ( | ) | const |
bool server::http::HttpRequest::IsBodyCompressed | ( | ) | const |
size_t server::http::HttpRequest::PathArgCount | ( | ) | const |
const std::string & server::http::HttpRequest::RequestBody | ( | ) | const |
const CookiesMap & server::http::HttpRequest::RequestCookies | ( | ) | const |
const HeadersMap & server::http::HttpRequest::RequestHeaders | ( | ) | const |
void server::http::HttpRequest::SetResponseStatus | ( | HttpStatus | status | ) | const |
Set the response status code.
Equivalent to this->GetHttpResponse().SetStatus(status).
|
friend |
Definition at line 228 of file http_request.hpp.