Open Lighting Architecture  0.9.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
ola::http::HTTPResponse Class Reference

Public Member Functions

 HTTPResponse (struct MHD_Connection *connection)
void Append (const std::string &data)
void SetContentType (const std::string &type)
void SetHeader (const std::string &key, const std::string &value)
void SetStatus (unsigned int status)
void SetNoCache ()
int SendJson (const ola::web::JsonValue &json)
int Send ()
struct MHD_Connection * Connection () const

Member Function Documentation

int ola::http::HTTPResponse::Send ( )

Send the HTTP response

Returns
true on success, false on error
int ola::http::HTTPResponse::SendJson ( const ola::web::JsonValue json)

Send a JsonObject as the response.

Returns
true on success, false on error
void ola::http::HTTPResponse::SetContentType ( const std::string &  type)

Set the content-type header

Parameters
typethe content type
Returns
true if the header was set correctly, false otherwise
void ola::http::HTTPResponse::SetHeader ( const std::string &  key,
const std::string &  value 
)

Set a header in the response

Parameters
keythe header name
valuethe header value
Returns
true if the header was set correctly, false otherwise
void ola::http::HTTPResponse::SetNoCache ( )

Set the appropriate headers so this response isn't cached


The documentation for this class was generated from the following files: