HTTP Request data.
More...
#include <userver/server/http/http_request.hpp>
HTTP Request data.
- Examples
- postgresql/functional_tests/basic_chaos/postgres_service.cpp, samples/config_service/config_service.cpp, samples/flatbuf_service/flatbuf_service.cpp, samples/grpc_service/grpc_service.cpp, samples/hello_service/hello_service.cpp, samples/http_caching/http_caching.cpp, samples/mongo_service/mongo_service.cpp, samples/postgres_auth/auth_bearer.cpp, samples/postgres_auth/postgres_service.cpp, samples/postgres_service/postgres_service.cpp, samples/redis_service/redis_service.cpp, samples/testsuite-support/src/logcapture.cpp, samples/testsuite-support/src/metrics.cpp, samples/testsuite-support/src/metrics.hpp, samples/testsuite-support/src/now.cpp, and samples/testsuite-support/src/testpoint.cpp.
Definition at line 26 of file http_request.hpp.
◆ CookiesMap
using server::http::HttpRequest::CookiesMap = std::unordered_map<std::string, std::string, utils::StrCaseHash> |
◆ CookiesMapKeys
using server::http::HttpRequest::CookiesMapKeys = decltype(utils::impl::MakeKeysView(CookiesMap())) |
◆ HeadersMap
◆ HeadersMapKeys
using server::http::HttpRequest::HeadersMapKeys = decltype(utils::impl::MakeKeysView(HeadersMap())) |
◆ ArgCount()
size_t server::http::HttpRequest::ArgCount |
( |
| ) |
const |
- Returns
- Count of arguments. Arguments are extracted from query part of the URL and from the HTTP body.
◆ ArgNames()
std::vector< std::string > server::http::HttpRequest::ArgNames |
( |
| ) |
const |
- Returns
- List of names of arguments. Arguments are extracted from query part of the URL and from the HTTP body.
◆ CookieCount()
size_t server::http::HttpRequest::CookieCount |
( |
| ) |
const |
- Returns
- Number of cookies.
◆ FormDataArgCount()
size_t server::http::HttpRequest::FormDataArgCount |
( |
| ) |
const |
- Returns
- Count of multipart/form-data arguments.
◆ FormDataArgNames()
std::vector< std::string > server::http::HttpRequest::FormDataArgNames |
( |
| ) |
const |
- Returns
- List of names of multipart/form-data arguments.
◆ GetArg()
const std::string & server::http::HttpRequest::GetArg |
( |
const std::string & |
arg_name | ) |
const |
◆ GetArgVector()
const std::vector< std::string > & server::http::HttpRequest::GetArgVector |
( |
const std::string & |
arg_name | ) |
const |
- Returns
- Argument values with name arg_name or an empty string if no such argument. Arguments are extracted from query part of the URL and from the HTTP body.
◆ GetCookie()
const std::string & server::http::HttpRequest::GetCookie |
( |
const std::string & |
cookie_name | ) |
const |
- Returns
- Value of the cookie with case sensitive name cookie_name, or an empty string if no such cookie exists.
◆ GetCookieNames()
CookiesMapKeys server::http::HttpRequest::GetCookieNames |
( |
| ) |
const |
- Returns
- List of cookies names.
◆ GetFormDataArg()
const FormDataArg & server::http::HttpRequest::GetFormDataArg |
( |
const std::string & |
arg_name | ) |
const |
- Returns
- First argument value with name arg_name from multipart/form-data request or an empty FormDataArg if no such argument.
◆ GetFormDataArgVector()
const std::vector< FormDataArg > & server::http::HttpRequest::GetFormDataArgVector |
( |
const std::string & |
arg_name | ) |
const |
- Returns
- Argument values with name arg_name from multipart/form-data request or an empty FormDataArg if no such argument.
◆ GetHeader()
const std::string & server::http::HttpRequest::GetHeader |
( |
const std::string & |
header_name | ) |
const |
◆ GetHeaderNames()
HeadersMapKeys server::http::HttpRequest::GetHeaderNames |
( |
| ) |
const |
- Returns
- List of headers names.
◆ GetHost()
const std::string & server::http::HttpRequest::GetHost |
( |
| ) |
const |
- Returns
- Host from the URL.
◆ GetHttpMajor()
int server::http::HttpRequest::GetHttpMajor |
( |
| ) |
const |
- Returns
- Major version of HTTP. For example, for HTTP 1.0 it returns 1
◆ GetHttpMinor()
int server::http::HttpRequest::GetHttpMinor |
( |
| ) |
const |
- Returns
- Minor version of HTTP. For example, for HTTP 1.0 it returns 0
◆ GetPathArg() [1/2]
const std::string & server::http::HttpRequest::GetPathArg |
( |
const std::string & |
arg_name | ) |
const |
- Returns
- Named argument from URL path with wildcards.
◆ GetPathArg() [2/2]
const std::string & server::http::HttpRequest::GetPathArg |
( |
size_t |
index | ) |
const |
- Returns
- Argument from URL path with wildcards by its 0-based index
◆ GetPathSuffix()
const std::string & server::http::HttpRequest::GetPathSuffix |
( |
| ) |
const |
- Returns
- Request path suffix, i.e. part of the path that remains after matching the path of a handler.
◆ GetRequestPath()
const std::string & server::http::HttpRequest::GetRequestPath |
( |
| ) |
const |
◆ GetUrl()
const std::string & server::http::HttpRequest::GetUrl |
( |
| ) |
const |
◆ HasArg()
bool server::http::HttpRequest::HasArg |
( |
const std::string & |
arg_name | ) |
const |
◆ HasCookie()
bool server::http::HttpRequest::HasCookie |
( |
const std::string & |
cookie_name | ) |
const |
- Returns
- true if cookie with case sensitive name cookie_name exists, false otherwise.
◆ HasFormDataArg()
bool server::http::HttpRequest::HasFormDataArg |
( |
const std::string & |
arg_name | ) |
const |
- Returns
- true if argument with name arg_name exists in multipart/form-data request, false otherwise.
◆ HasHeader()
bool server::http::HttpRequest::HasHeader |
( |
const std::string & |
header_name | ) |
const |
- Returns
- true if header with case insensitive name header_name exists, false otherwise.
◆ HasPathArg() [1/2]
bool server::http::HttpRequest::HasPathArg |
( |
const std::string & |
arg_name | ) |
const |
- Returns
- true if named argument from URL path with wildcards exists, false otherwise.
◆ HasPathArg() [2/2]
bool server::http::HttpRequest::HasPathArg |
( |
size_t |
index | ) |
const |
- Returns
- true if argument with index from URL path with wildcards exists, false otherwise.
◆ HeaderCount()
size_t server::http::HttpRequest::HeaderCount |
( |
| ) |
const |
- Returns
- Number of headers.
◆ IsBodyCompressed()
bool server::http::HttpRequest::IsBodyCompressed |
( |
| ) |
const |
- Returns
- true if the body of the request was compressed
◆ PathArgCount()
size_t server::http::HttpRequest::PathArgCount |
( |
| ) |
const |
- Returns
- Number of wildcard arguments in URL path.
◆ RequestBody()
const std::string & server::http::HttpRequest::RequestBody |
( |
| ) |
const |
◆ SetResponseStatus()
void server::http::HttpRequest::SetResponseStatus |
( |
HttpStatus |
status | ) |
const |
The documentation for this class was generated from the following file: