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