7 #ifndef HTTP_RESPONSE_H
8 #define HTTP_RESPONSE_H
14 #include <boost/lexical_cast.hpp>
15 #include <boost/shared_ptr.hpp>
150 virtual void reset();
159 virtual std::string
getBody()
const;
197 virtual std::string
toString()
const;
static const CallSetGenericBody & no()
Returns encapsulated false.
boost::shared_ptr< const HttpResponse > ConstHttpResponsePtr
Pointer to the const HttpResponse object.
virtual void finalize()
Completes creation of the HTTP response.
data::ConstElementPtr getJsonElement(const std::string &element_name) const
Retrieves a single JSON element.
Generic exception thrown by HttpMessage class.
static bool isClientError(const HttpStatusCode &status_code)
Checks if the status code indicates client error.
std::string getStatusPhrase() const
Returns HTTP status phrase.
virtual std::string toString() const
Returns HTTP response as string.
virtual std::string getBody() const
Returns HTTP response body as string.
const HttpResponseContextPtr & context() const
Returns pointer to the HttpResponseContext.
virtual void create()
Commits information held in the context into the response.
CallSetGenericBody(const bool set)
Constructor.
HttpResponseContextPtr context_
Pointer to the HttpResponseContext holding parsed data.
Base class for HttpRequest and HttpResponse.
Represents HTTP response message.
boost::shared_ptr< HttpResponse > HttpResponsePtr
Pointer to the HttpResponse object.
HttpResponseError(const char *file, size_t line, const char *what)
boost::shared_ptr< const Element > ConstElementPtr
int version()
returns Kea hooks version.
virtual std::string getDateHeaderValue() const
Returns current time formatted as required by RFC 1123.
static const CallSetGenericBody & yes()
Returns encapsulated true.
Generic exception thrown by HttpResponse class.
static bool isServerError(const HttpStatusCode &status_code)
Checks if the status code indicates server error.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
HttpStatusCode getStatusCode() const
Returns HTTP status code.
static std::string statusCodeToString(const HttpStatusCode &status_code)
Converts status code to string.
Defines the logger used by the top-level component of kea-dhcp-ddns.
virtual void reset()
Reset the state of the object.
std::string toBriefString() const
Returns HTTP version and HTTP status as a string.
static uint16_t statusCodeToNumber(const HttpStatusCode &status_code)
Convenience method converting status code to numeric value.
HttpResponse()
Constructor for the inbound HTTP response.
boost::shared_ptr< HttpResponseContext > HttpResponseContextPtr
Pointer to the HttpResponseContext.
bool set_
A storage for the boolean flag.
Encapsulates the boolean value indicating if the HttpResponse constructor should call its setGenericB...
HttpStatusCode
HTTP status codes (cf RFC 2068)