HttpReq is an encapsulation class for http requests, which provides access to method, path, body, etc. It is not allowed to be created externally. Some components of the uri do not provide access functions.
More...
#include <EVHttpServer.h>
HttpReq is an encapsulation class for http requests, which provides access to method, path, body, etc. It is not allowed to be created externally. Some components of the uri do not provide access functions.
◆ body()
std::string EVHttpServer::HttpReq::body |
( |
| ) |
const |
Get http request body.
- Returns
- body string
◆ bodyRaw()
std::unique_ptr< char[]> EVHttpServer::HttpReq::bodyRaw |
( |
| ) |
const |
Get http request body raw data.
- Returns
- std::unique_ptr which provides raw data of body
◆ findHeader()
bool EVHttpServer::HttpReq::findHeader |
( |
const std::string & |
key, |
|
|
std::string & |
value |
|
) |
| const |
find header in http request
- Parameters
-
[in] | key | : header name |
[out] | value | : header value |
- Return values
-
true | : find success |
false | : not found |
◆ findQuery()
bool EVHttpServer::HttpReq::findQuery |
( |
const std::string & |
key, |
|
|
std::string & |
value |
|
) |
| const |
find http query
- Parameters
-
[in] | key | : query name |
[out] | value | : query value |
- Return values
-
true | : find success |
false | : not found |
◆ headers()
void EVHttpServer::HttpReq::headers |
( |
std::list< HttpKeyVal > & |
ret | ) |
const |
Get http request headers.
- Parameters
-
[out] | ret | : A list for storing http request headers |
- Returns
- void
◆ host()
std::string EVHttpServer::HttpReq::host |
( |
| ) |
const |
Get http request host.
- Returns
- Returns the host associated with the request. If a client sends an absolute URI, the host part of that is preferred. Otherwise, the input headers are searched for a Host: header. NULL is returned if no absolute URI or Host:header is provided.
◆ method()
Get http request method.
- Returns
- The return value is the enumeration type of ReqType
◆ methodStr()
std::string EVHttpServer::HttpReq::methodStr |
( |
| ) |
const |
Get http request method string.
- Returns
- The return value is after converting the ReqType(evhttp_cmd_type) enumeration type to a string, as listed below: "GET","POST","HEAD","PUT","DELETE","OPTIONS","TRACE","CONNECT","PATCH"
◆ path()
std::string EVHttpServer::HttpReq::path |
( |
| ) |
const |
Get http request path.
- Returns
- path string
◆ querys()
void EVHttpServer::HttpReq::querys |
( |
std::list< HttpKeyVal > & |
ret | ) |
const |
Get querys in http request.
- Parameters
-
[out] | ret | : A list for storing http request querys |
- Returns
- void
◆ uri()
std::string EVHttpServer::HttpReq::uri |
( |
| ) |
const |
Get http request uri.
- Returns
- uri string
The documentation for this class was generated from the following files: