Kea
1.9.9-git
|
Represents HTTP POST request. More...
#include <post_request.h>
Public Member Functions | |
PostHttpRequest () | |
Constructor for inbound HTTP request. More... | |
PostHttpRequest (const Method &method, const std::string &uri, const HttpVersion &version, const HostHttpHeader &host_header=HostHttpHeader(), const BasicHttpAuthPtr &basic_auth=BasicHttpAuthPtr()) | |
Constructor for outbound HTTP request. More... | |
Public Member Functions inherited from isc::http::HttpRequest | |
HttpRequest () | |
Constructor for inbound HTTP request. More... | |
HttpRequest (const Method &method, const std::string &uri, const HttpVersion &version, const HostHttpHeader &host_header=HostHttpHeader(), const BasicHttpAuthPtr &basic_auth=BasicHttpAuthPtr()) | |
Constructor for outbound HTTP request. More... | |
const HttpRequestContextPtr & | context () const |
Returns pointer to the HttpRequestContext. More... | |
virtual void | create () |
Commits information held in the context into the request. More... | |
virtual void | finalize () |
Completes creation of the HTTP request. More... | |
std::string | getBody () const |
Returns HTTP message body as string. More... | |
Method | getMethod () const |
Returns HTTP method of the request. More... | |
std::string | getUri () const |
Returns HTTP request URI. More... | |
bool | isPersistent () const |
Checks if the client has requested persistent connection. More... | |
void | requireHttpMethod (const HttpRequest::Method &method) |
Specifies an HTTP method allowed for the request. More... | |
virtual void | reset () |
Reset the state of the object. More... | |
std::string | toBriefString () const |
Returns HTTP method, URI and HTTP version as a string. More... | |
virtual std::string | toString () const |
Returns HTTP message as string. More... | |
Public Member Functions inherited from isc::http::HttpMessage | |
HttpMessage (const Direction &direction) | |
Constructor. More... | |
virtual | ~HttpMessage () |
Destructor. More... | |
Direction | getDirection () const |
Returns HTTP message direction. More... | |
HttpHeaderPtr | getHeader (const std::string &header_name) const |
Returns object encapsulating HTTP header. More... | |
std::string | getHeaderValue (const std::string &header_name) const |
Returns a value of the specified HTTP header. More... | |
uint64_t | getHeaderValueAsUint64 (const std::string &header_name) const |
Returns a value of the specified HTTP header as number. More... | |
HttpVersion | getHttpVersion () const |
Returns HTTP version number (major and minor). More... | |
bool | isFinalized () const |
Checks if the message has been successfully finalized. More... | |
void | requireHeader (const std::string &header_name) |
Specifies a required HTTP header for the HTTP message. More... | |
void | requireHeaderValue (const std::string &header_name, const std::string &header_value) |
Specifies a required value of a header in the message. More... | |
void | requireHttpVersion (const HttpVersion &version) |
Specifies HTTP version allowed. More... | |
bool | requiresBody () const |
Checks if the body is required for the HTTP message. More... | |
void | setDirection (const Direction &direction) |
Sets direction for the HTTP message. More... | |
Public Member Functions inherited from isc::hooks::CalloutHandleAssociate | |
CalloutHandleAssociate () | |
Constructor. More... | |
CalloutHandlePtr | getCalloutHandle () |
Returns callout handle. More... | |
Additional Inherited Members | |
Public Types inherited from isc::http::HttpRequest | |
enum | Method { Method::HTTP_GET, Method::HTTP_POST, Method::HTTP_HEAD, Method::HTTP_PUT, Method::HTTP_DELETE, Method::HTTP_OPTIONS, Method::HTTP_CONNECT, Method::HTTP_METHOD_UNKNOWN } |
HTTP methods. More... | |
Public Types inherited from isc::http::HttpMessage | |
enum | Direction { INBOUND, OUTBOUND } |
Specifies the direction of the HTTP message. More... | |
Protected Types inherited from isc::http::HttpMessage | |
typedef std::map< std::string, HttpHeaderPtr > | HttpHeaderMap |
Map of HTTP headers indexed by lower case header names. More... | |
Protected Member Functions inherited from isc::http::HttpRequest | |
Method | methodFromString (std::string method) const |
Converts HTTP method specified in textual format to Method. More... | |
std::string | methodToString (const HttpRequest::Method &method) const |
Converts HTTP method to string. More... | |
Protected Member Functions inherited from isc::http::HttpMessage | |
void | checkCreated () const |
Checks if the create was called. More... | |
void | checkFinalized () const |
Checks if the finalize was called. More... | |
template<typename T > | |
bool | inRequiredSet (const T &element, const std::set< T > &element_set) const |
Checks if the set is empty or the specified element belongs to this set. More... | |
Protected Attributes inherited from isc::http::HttpRequest | |
HttpRequestContextPtr | context_ |
Pointer to the HttpRequestContext holding parsed data. More... | |
Method | method_ |
HTTP method of the request. More... | |
std::set< Method > | required_methods_ |
Set of required HTTP methods. More... | |
Protected Attributes inherited from isc::http::HttpMessage | |
bool | created_ |
Flag indicating whether create was called. More... | |
Direction | direction_ |
Message direction (inbound or outbound). More... | |
bool | finalized_ |
Flag indicating whether finalize was called. More... | |
HttpHeaderMap | headers_ |
Parsed HTTP headers. More... | |
HttpVersion | http_version_ |
HTTP version numbers. More... | |
HttpHeaderMap | required_headers_ |
Map holding required HTTP headers. More... | |
std::set< HttpVersion > | required_versions_ |
Set of required HTTP versions. More... | |
Protected Attributes inherited from isc::hooks::CalloutHandleAssociate | |
CalloutHandlePtr | callout_handle_ |
Callout handle stored. More... | |
Represents HTTP POST request.
Instructs the parent class to require:
Definition at line 29 of file post_request.h.
isc::http::PostHttpRequest::PostHttpRequest | ( | ) |
Constructor for inbound HTTP request.
Definition at line 14 of file post_request.cc.
References isc::http::HttpRequest::HTTP_POST, isc::http::HttpMessage::requireHeader(), and isc::http::HttpRequest::requireHttpMethod().
isc::http::PostHttpRequest::PostHttpRequest | ( | const Method & | method, |
const std::string & | uri, | ||
const HttpVersion & | version, | ||
const HostHttpHeader & | host_header = HostHttpHeader() , |
||
const BasicHttpAuthPtr & | basic_auth = BasicHttpAuthPtr() |
||
) |
Constructor for outbound HTTP request.
method | HTTP method, e.g. POST. |
uri | URI. |
version | HTTP version. |
host_header | Host header to be included in the request. The default is the empty Host header. |
basic_auth | Basic HTTP authentication credential. The default is no authentication. |
Definition at line 21 of file post_request.cc.
References isc::http::HttpRequest::HTTP_POST, isc::http::HttpMessage::requireHeader(), and isc::http::HttpRequest::requireHttpMethod().