pion-net
4.0.9
|
#include <HTTPRequest.hpp>
Inherits pion::net::HTTPMessage.
Public Member Functions | |
HTTPRequest (const std::string &resource) | |
HTTPRequest (void) | |
constructs a new HTTPRequest object (default constructor) | |
virtual | ~HTTPRequest () |
virtual destructor | |
virtual void | clear (void) |
clears all request data | |
virtual bool | isContentLengthImplied (void) const |
the content length of the message can never be implied for requests | |
const std::string & | getMethod (void) const |
returns the request method (i.e. GET, POST, PUT) | |
const std::string & | getResource (void) const |
returns the resource uri-stem to be delivered (possibly the result of a redirect) | |
const std::string & | getOriginalResource (void) const |
returns the resource uri-stem originally requested | |
const std::string & | getQueryString (void) const |
returns the uri-query or query string requested | |
const std::string & | getQuery (const std::string &key) const |
returns a value for the query key if any are defined; otherwise, an empty string | |
QueryParams & | getQueryParams (void) |
returns the query parameters | |
bool | hasQuery (const std::string &key) const |
returns true if at least one value for the query key is defined | |
void | setMethod (const std::string &str) |
sets the HTTP request method (i.e. GET, POST, PUT) | |
void | setResource (const std::string &str) |
sets the resource or uri-stem originally requested | |
void | changeResource (const std::string &str) |
changes the resource or uri-stem to be delivered (called as the result of a redirect) | |
void | setQueryString (const std::string &str) |
sets the uri-query or query string requested | |
void | addQuery (const std::string &key, const std::string &value) |
adds a value for the query key | |
void | changeQuery (const std::string &key, const std::string &value) |
changes the value of a query key | |
void | deleteQuery (const std::string &key) |
removes all values for a query key | |
void | useQueryParamsForQueryString (void) |
use the query parameters to build a query string for the request | |
void | useQueryParamsForPostContent (void) |
use the query parameters to build POST content for the request | |
void | setContent (const std::string &value) |
add content (for POST) from string | |
void | setUser (PionUserPtr user) |
sets the user record for HTTP request after authentication | |
PionUserPtr | getUser () const |
get the user record for HTTP request after authentication | |
![]() | |
virtual | ~HTTPTypes () |
virtual destructor | |
Protected Member Functions | |
virtual void | updateFirstLine (void) const |
updates the string containing the first line for the HTTP message | |
Additional Inherited Members | |
defines message data integrity status codes | |
![]() | |
static std::string | get_date_string (const time_t t) |
converts time_t format into an HTTP-date string | |
static std::string | make_query_string (const QueryParams &query_params) |
builds an HTTP query string from a collection of query parameters | |
static std::string | make_set_cookie_header (const std::string &name, const std::string &value, const std::string &path, const bool has_max_age=false, const unsigned long max_age=0) |
![]() | |
static const std::string | STRING_EMPTY |
static const std::string | STRING_CRLF |
static const std::string | STRING_HTTP_VERSION |
static const std::string | HEADER_NAME_VALUE_DELIMITER |
static const std::string | HEADER_HOST |
static const std::string | HEADER_COOKIE |
static const std::string | HEADER_SET_COOKIE |
static const std::string | HEADER_CONNECTION |
static const std::string | HEADER_CONTENT_TYPE |
static const std::string | HEADER_CONTENT_LENGTH |
static const std::string | HEADER_CONTENT_LOCATION |
static const std::string | HEADER_CONTENT_ENCODING |
static const std::string | HEADER_LAST_MODIFIED |
static const std::string | HEADER_IF_MODIFIED_SINCE |
static const std::string | HEADER_TRANSFER_ENCODING |
static const std::string | HEADER_LOCATION |
static const std::string | HEADER_AUTHORIZATION |
static const std::string | HEADER_REFERER |
static const std::string | HEADER_USER_AGENT |
static const std::string | HEADER_X_FORWARDED_FOR |
static const std::string | HEADER_CLIENT_IP |
static const std::string | CONTENT_TYPE_HTML |
static const std::string | CONTENT_TYPE_TEXT |
static const std::string | CONTENT_TYPE_XML |
static const std::string | CONTENT_TYPE_URLENCODED |
static const std::string | REQUEST_METHOD_HEAD |
static const std::string | REQUEST_METHOD_GET |
static const std::string | REQUEST_METHOD_PUT |
static const std::string | REQUEST_METHOD_POST |
static const std::string | REQUEST_METHOD_DELETE |
static const std::string | RESPONSE_MESSAGE_OK |
static const std::string | RESPONSE_MESSAGE_CREATED |
static const std::string | RESPONSE_MESSAGE_ACCEPTED |
static const std::string | RESPONSE_MESSAGE_NO_CONTENT |
static const std::string | RESPONSE_MESSAGE_FOUND |
static const std::string | RESPONSE_MESSAGE_UNAUTHORIZED |
static const std::string | RESPONSE_MESSAGE_FORBIDDEN |
static const std::string | RESPONSE_MESSAGE_NOT_FOUND |
static const std::string | RESPONSE_MESSAGE_METHOD_NOT_ALLOWED |
static const std::string | RESPONSE_MESSAGE_NOT_MODIFIED |
static const std::string | RESPONSE_MESSAGE_BAD_REQUEST |
static const std::string | RESPONSE_MESSAGE_SERVER_ERROR |
static const std::string | RESPONSE_MESSAGE_NOT_IMPLEMENTED |
static const std::string | RESPONSE_MESSAGE_CONTINUE |
static const unsigned int | RESPONSE_CODE_OK = 200 |
static const unsigned int | RESPONSE_CODE_CREATED = 201 |
static const unsigned int | RESPONSE_CODE_ACCEPTED = 202 |
static const unsigned int | RESPONSE_CODE_NO_CONTENT = 204 |
static const unsigned int | RESPONSE_CODE_FOUND = 302 |
static const unsigned int | RESPONSE_CODE_UNAUTHORIZED = 401 |
static const unsigned int | RESPONSE_CODE_FORBIDDEN = 403 |
static const unsigned int | RESPONSE_CODE_NOT_FOUND = 404 |
static const unsigned int | RESPONSE_CODE_METHOD_NOT_ALLOWED = 405 |
static const unsigned int | RESPONSE_CODE_NOT_MODIFIED = 304 |
static const unsigned int | RESPONSE_CODE_BAD_REQUEST = 400 |
static const unsigned int | RESPONSE_CODE_SERVER_ERROR = 500 |
static const unsigned int | RESPONSE_CODE_NOT_IMPLEMENTED = 501 |
static const unsigned int | RESPONSE_CODE_CONTINUE = 100 |
HTTPRequest: container for HTTP request information
Definition at line 25 of file HTTPRequest.hpp.
|
inline |
constructs a new HTTPRequest object
resource | the HTTP resource to request |
Definition at line 35 of file HTTPRequest.hpp.