 |
Kea
1.5.0
|
Go to the documentation of this file.
16 PostHttpRequestJson::PostHttpRequestJson()
68 const std::map<std::string, ConstElementPtr>& map_value = body->mapValue();
69 auto map_element = map_value.find(element_name);
70 if (map_element != map_value.end()) {
71 return (map_element->second);
75 }
catch (
const std::exception& ex) {
77 << element_name <<
": " << ex.
what());
89 }
catch (
const std::exception& ex) {
91 " request: " << ex.
what());
void checkFinalized() const
Checks if the finalize was called.
virtual void reset()
Reset the state of the object.
int version()
returns Kea hooks version.
Exception thrown when body of the HTTP message is not JSON.
data::ConstElementPtr json_
Pointer to the parsed JSON body.
HttpRequestContextPtr context_
Pointer to the HttpRequestContext holding parsed data.
Represents HTTP POST request.
void setBodyAsJson(const data::ConstElementPtr &body)
Sets JSON body for an outbound message.
Defines the logger used by the top-level component of kea-dhcp-ddns.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
void parseBodyAsJson()
Interprets body as JSON, which can be later retrieved using data element objects.
data::ConstElementPtr getJsonElement(const std::string &element_name) const
Retrieves a single JSON element.
bool created_
Flag indicating whether create was called.
bool finalized_
Flag indicating whether finalize was called.
const HttpRequestContextPtr & context() const
Returns pointer to the HttpRequestContext.
virtual void finalize()
Complete parsing of the HTTP request.
data::ConstElementPtr getBodyAsJson() const
Retrieves JSON body.
boost::shared_ptr< const Element > ConstElementPtr
void requireHeaderValue(const std::string &header_name, const std::string &header_value)
Specifies a required value of a header in the message.
virtual void create()
Commits information held in the context into the request.
PostHttpRequestJson()
Constructor for inbound HTTP request.
virtual void reset()
Reset the state of the object.