15 : direction_(direction), required_versions_(),
16 http_version_(
HttpVersion::HTTP_10()), required_headers_(),
17 created_(false), finalized_(false), headers_() {
38 const std::string& header_value) {
66 return (header_it->second);
70 " not found in the request");
75 return (
getHeader(header_name)->getValue());
81 return (
getHeader(header_name)->getUint64Value());
83 }
catch (
const std::exception& ex) {
93 " message because the HttpMessage::create() must be"
94 " called first. This is a programmatic error");
102 " message because the HttpMessage::finalize() must be"
103 " called first. This is a programmatic error");
boost::shared_ptr< HttpHeader > HttpHeaderPtr
Pointer to the HttpHeader class.
Generic exception thrown by HttpMessage class.
std::string getHeaderValue(const std::string &header_name) const
Returns a value of the specified HTTP header.
bool finalized_
Flag indicating whether finalize was called.
void requireHttpVersion(const HttpVersion &version)
Specifies HTTP version allowed.
HttpHeaderPtr getHeader(const std::string &header_name) const
Returns object encapsulating HTTP header.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
virtual ~HttpMessage()
Destructor.
bool created_
Flag indicating whether create was called.
HttpHeaderMap required_headers_
Map holding required HTTP headers.
Direction
Specifies the direction of the HTTP message.
HttpVersion getHttpVersion() const
Returns HTTP version number (major and minor).
int version()
returns Kea hooks version.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
Defines the logger used by the top-level component of kea-dhcp-ddns.
void checkFinalized() const
Checks if the finalize was called.
HttpVersion http_version_
HTTP version numbers.
std::set< HttpVersion > required_versions_
Set of required HTTP versions.
void requireHeader(const std::string &header_name)
Specifies a required HTTP header for the HTTP message.
HttpHeaderMap headers_
Parsed HTTP headers.
void checkCreated() const
Checks if the create was called.
void requireHeaderValue(const std::string &header_name, const std::string &header_value)
Specifies a required value of a header in the message.
uint64_t getHeaderValueAsUint64(const std::string &header_name) const
Returns a value of the specified HTTP header as number.
HttpMessage(const Direction &direction)
Constructor.
bool requiresBody() const
Checks if the body is required for the HTTP message.