7#ifndef HTTP_RESPONSE_JSON_H
8#define HTTP_RESPONSE_JSON_H
24class HttpResponseJson;
int version()
returns Kea hooks version.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
Generic exception thrown by HttpResponse class.
Exception thrown when body of the HTTP message is not JSON.
HttpResponseJsonError(const char *file, size_t line, const char *what)
Represents HTTP response with JSON content.
void setBodyAsJson(const data::ConstElementPtr &json_body)
Generates JSON content from the data structures represented as data::ConstElementPtr.
void parseBodyAsJson()
Interprets body as JSON, which can be later retrieved using data element objects.
data::ConstElementPtr json_
Pointer to the parsed JSON body.
HttpResponseJson()
Constructor for the inbound HTTP response.
virtual void finalize()
Completes creation of the HTTP response.
virtual void reset()
Reset the state of the object.
data::ConstElementPtr getJsonElement(const std::string &element_name) const
Retrieves a single JSON element.
data::ConstElementPtr getBodyAsJson() const
Retrieves JSON body.
Represents HTTP response message.
boost::shared_ptr< const Element > ConstElementPtr
HttpStatusCode
HTTP status codes (cf RFC 2068)
boost::shared_ptr< HttpResponseJson > HttpResponseJsonPtr
Pointer to the HttpResponseJson object.
Defines the logger used by the top-level component of kea-lfc.
Encapsulates the boolean value indicating if the HttpResponse constructor should call its setGenericB...
static const CallSetGenericBody & yes()
Returns encapsulated true.