Open Lighting Architecture  Latest Git
Public Member Functions | List of all members
ola::http::HTTPRequest Class Reference

Public Member Functions

 HTTPRequest (const std::string &url, const std::string &method, const std::string &version, struct MHD_Connection *connection)
 
bool Init ()
 
const std::string Url () const
 
const std::string Method () const
 
const std::string Version () const
 
void AddHeader (const std::string &key, const std::string &value)
 Add a header to the request object. More...
 
void AddPostParameter (const std::string &key, const std::string &value)
 Add a post parameter. More...
 
void ProcessPostData (const char *data, size_t *data_size)
 Process post data.
 
const std::string GetHeader (const std::string &key) const
 Return the value of the header sent with this request. More...
 
bool CheckParameterExists (const std::string &key) const
 Return whether an url parameter exists. More...
 
const std::string GetParameter (const std::string &key) const
 Return the value of a url parameter. More...
 
const std::string GetPostParameter (const std::string &key) const
 Lookup a post parameter in this request. More...
 
bool InFlight () const
 
void SetInFlight ()
 

Member Function Documentation

◆ AddHeader()

void ola::http::HTTPRequest::AddHeader ( const std::string &  key,
const std::string &  value 
)

Add a header to the request object.

Parameters
keythe header name
valuethe value of the header

◆ AddPostParameter()

void ola::http::HTTPRequest::AddPostParameter ( const std::string &  key,
const std::string &  value 
)

Add a post parameter.

This can be called multiple times and the values will be appended.

Parameters
keythe parameter name
valuethe value

◆ CheckParameterExists()

bool ola::http::HTTPRequest::CheckParameterExists ( const std::string &  key) const

Return whether an url parameter exists.

Parameters
keythe name of the parameter
Returns
if the parameter exists

◆ GetHeader()

const string ola::http::HTTPRequest::GetHeader ( const std::string &  key) const

Return the value of the header sent with this request.

Parameters
keythe name of the header
Returns
the value of the header or empty string if it doesn't exist.

◆ GetParameter()

const string ola::http::HTTPRequest::GetParameter ( const std::string &  key) const

Return the value of a url parameter.

Parameters
keythe name of the parameter
Returns
the value of the parameter

◆ GetPostParameter()

const string ola::http::HTTPRequest::GetPostParameter ( const std::string &  key) const

Lookup a post parameter in this request.

Parameters
keythe name of the parameter
Returns
the value of the parameter or the empty string if it doesn't exist

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