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;
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 HttpMessage class.
Base class for HttpRequest and HttpResponse.
Generic exception thrown by HttpResponse class.
HttpResponseError(const char *file, size_t line, const char *what)
Represents HTTP response message.
HttpResponseContextPtr context_
Pointer to the HttpResponseContext holding parsed data.
virtual std::string getBody() const
Returns HTTP response body as string.
HttpResponse()
Constructor for the inbound HTTP response.
static uint16_t statusCodeToNumber(const HttpStatusCode &status_code)
Convenience method converting status code to numeric value.
static bool isClientError(const HttpStatusCode &status_code)
Checks if the status code indicates client error.
HttpStatusCode getStatusCode() const
Returns HTTP status code.
virtual std::string getDateHeaderValue() const
Returns current time formatted as required by RFC 1123.
static bool isServerError(const HttpStatusCode &status_code)
Checks if the status code indicates server error.
std::string toBriefString() const
Returns HTTP version and HTTP status as a string.
virtual void finalize()
Completes creation of the HTTP response.
virtual std::string toString() const
Returns HTTP response as string.
const HttpResponseContextPtr & context() const
Returns pointer to the HttpResponseContext.
std::string getStatusPhrase() const
Returns HTTP status phrase.
virtual void reset()
Reset the state of the object.
virtual void create()
Commits information held in the context into the response.
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.
boost::shared_ptr< const Element > ConstElementPtr
HttpStatusCode
HTTP status codes (cf RFC 2068)
boost::shared_ptr< const HttpResponse > ConstHttpResponsePtr
Pointer to the const HttpResponse object.
boost::shared_ptr< HttpResponse > HttpResponsePtr
Pointer to the HttpResponse object.
boost::shared_ptr< HttpResponseContext > HttpResponseContextPtr
Pointer to the HttpResponseContext.
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...
CallSetGenericBody(const bool set)
Constructor.
bool set_
A storage for the boolean flag.
static const CallSetGenericBody & no()
Returns encapsulated false.
static const CallSetGenericBody & yes()
Returns encapsulated true.