Kea: isc::http::PostHttpRequest Class Reference

| Kea 3.0.3-git

isc::http::PostHttpRequest Class Reference

Represents HTTP POST request. More...

`#include <post_request.h>`

Inheritance diagram for isc::http::PostHttpRequest:
[legend]

## Public Member Functions
| PostHttpRequest ()
| Constructor for inbound HTTP request.
| 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.
Public Member Functions inherited from isc::http::HttpRequest
| HttpRequest ()
| Constructor for inbound HTTP request.
| 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.
const HttpRequestContextPtr & | context () const
| Returns pointer to the HttpRequestContext.
virtual void | create ()
| Commits information held in the context into the request.
virtual void | finalize ()
| Completes creation of the HTTP request.
std::string | getBasicAuth () const
| Returns recorded basic auth.
std::string | getBody () const
| Returns HTTP message body as string.
std::string | getCustom () const
| Returns recorded custom name.
std::string | getIssuer () const
| Returns recorded issuer name.
Method | getMethod () const
| Returns HTTP method of the request.
std::string | getRemote () const
| Returns remote address.
std::string | getSubject () const
| Returns recorded subject name.
bool | getTls () const
| Access control parameters: get/set methods.
std::string | getUri () const
| Returns HTTP request URI.
bool | isPersistent () const
| Checks if the client has requested persistent connection.
void | requireHttpMethod (const HttpRequest::Method &method)
| Specifies an HTTP method allowed for the request.
virtual void | reset ()
| Reset the state of the object.
void | setBasicAuth (const std::string &basic_auth)
| Set (record) basic auth.
void | setCustom (const std::string &custom)
| Set (record) custom name.
void | setIssuer (const std::string &issuer)
| Set (record) issuer name.
void | setRemote (const std::string &remote)
| Set remote address.
void | setSubject (const std::string &subject)
| Set (record) subject name.
void | setTls (bool tls)
| Set (record) TLS usage.
std::string | toBriefString () const
| Returns HTTP method, URI and HTTP version as a string.
virtual std::string | toString () const
| Returns HTTP message as string.
Public Member Functions inherited from isc::http::HttpMessage
| HttpMessage (const Direction &direction)
| Constructor.
virtual | ~HttpMessage ()
| Destructor.
Direction | getDirection () const
| Returns HTTP message direction.
HttpHeaderPtr | getHeader (const std::string &header_name) const
| Returns object encapsulating HTTP header.
std::string | getHeaderValue (const std::string &header_name) const
| Returns a value of the specified HTTP header.
uint64_t | getHeaderValueAsUint64 (const std::string &header_name) const
| Returns a value of the specified HTTP header as number.
HttpVersion | getHttpVersion () const
| Returns HTTP version number (major and minor).
bool | isFinalized () const
| Checks if the message has been successfully finalized.
void | requireHeader (const std::string &header_name)
| Specifies a required HTTP header for the HTTP message.
void | requireHeaderValue (const std::string &header_name, const std::string &header_value)
| Specifies a required value of a header in the message.
void | requireHttpVersion (const HttpVersion &version)
| Specifies HTTP version allowed.
bool | requiresBody () const
| Checks if the body is required for the HTTP message.
void | setDirection (const Direction &direction)
| Sets direction for the HTTP message.
Public Member Functions inherited from isc::hooks::CalloutHandleAssociate
| CalloutHandleAssociate ()
| Constructor.
CalloutHandlePtr | getCalloutHandle ()
| Returns callout handle.
void | resetCalloutHandle ()
| Reset callout handle.

## Additional Inherited Members
Public Types inherited from isc::http::HttpRequest
enum class | Method { HTTP_GET , HTTP_POST , HTTP_HEAD , HTTP_PUT , HTTP_DELETE , HTTP_OPTIONS , HTTP_CONNECT , 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...
Static Public Attributes inherited from isc::http::HttpRequest
static bool | recordBasicAuth_ = false
| Record basic auth.
static bool | recordIssuer_ = false
| Record issuer name.
static bool | recordSubject_ = false
| Access control parameters: Flags which indicate what information to record.
Protected Types inherited from isc::http::HttpMessage
typedef std::map< std::string, HttpHeaderPtr > | HttpHeaderMap
| Map of HTTP headers indexed by lower case header names.
Protected Member Functions inherited from isc::http::HttpRequest
Method | methodFromString (std::string method) const
| Converts HTTP method specified in textual format to Method.
std::string | methodToString (const HttpRequest::Method &method) const
| Converts HTTP method to string.
Protected Member Functions inherited from isc::http::HttpMessage
void | checkCreated () const
| Checks if the create was called.
void | checkFinalized () const
| Checks if the finalize was called.
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.
Protected Attributes inherited from isc::http::HttpRequest
std::string | basic_auth_
| Basic auth.
HttpRequestContextPtr | context_
| Pointer to the HttpRequestContext holding parsed data.
std::string | custom_
| Custom name.
std::string | issuer_
| Issuer name.
Method | method_
| HTTP method of the request.
std::string | remote_
| Remote address.
std::set< Method > | required_methods_
| Set of required HTTP methods.
std::string | subject_
| Subject name.
bool | tls_
| TLS usage.
Protected Attributes inherited from isc::http::HttpMessage
bool | created_
| Flag indicating whether create was called.
Direction | direction_
| Message direction (inbound or outbound).
bool | finalized_
| Flag indicating whether finalize was called.
HttpHeaderMap | headers_
| Parsed HTTP headers.
HttpVersion | http_version_
| HTTP version numbers.
HttpHeaderMap | required_headers_
| Map holding required HTTP headers.
std::set< HttpVersion > | required_versions_
| Set of required HTTP versions.
Protected Attributes inherited from isc::hooks::CalloutHandleAssociate
CalloutHandlePtr | callout_handle_
| Callout handle stored.

## Detailed Description

Represents HTTP POST request.

Instructs the parent class to require:

- HTTP POST message type,
- Content-Length header,
- Content-Type header.

Definition at line 29 of file post_request.h.

## Constructor & Destructor Documentation

## ◆ PostHttpRequest() [1/2]

isc::http::PostHttpRequest::PostHttpRequest | ( |  | ) |

Constructor for inbound HTTP request.

Definition at line 14 of file post_request.cc.

References isc::http::HttpRequest::HttpRequest(), isc::http::HttpRequest::HTTP_POST, isc::http::HttpMessage::requireHeader(), and isc::http::HttpRequest::requireHttpMethod().

Referenced by isc::http::PostHttpRequestJson::PostHttpRequestJson(), and isc::http::PostHttpRequestJson::PostHttpRequestJson().

Here is the call graph for this function:

## ◆ PostHttpRequest() [2/2]

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.

Parameters

  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::HttpRequest(), isc::http::HttpRequest::HTTP_POST, isc::http::HttpMessage::requireHeader(), isc::http::HttpRequest::requireHttpMethod(), and version().

Here is the call graph for this function:

The documentation for this class was generated from the following files:

- post_request.h
- post_request.cc