Open Lighting Architecture: ola::HTTPResponse Class Reference

| Open Lighting Architecture 0.10.9

Loading...
Searching...
No Matches
Public Member Functions | List of all members
ola::HTTPResponse Class Reference

## Public Member Functions
| HTTPResponse (struct MHD_Connection *connection)
void | Append (const std::string &data)
void | SetContentType (const std::string &type)
| Set the content-type header.
void | SetHeader (const std::string &key, const std::string &value)
| Set a header in the response.
void | SetStatus (unsigned int status)
void | SetNoCache ()
| Set the appropriate headers so this response isn't cached.
int | SendJson (const ola::web::JsonValue &json)
| Send a JsonObject as the response.
int | Send ()
| Send the HTTP response.
struct MHD_Connection * | Connection () const

## Member Function Documentation

## ◆ Send()

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

Send the HTTP response.

Returns
  true on success, false on error

## ◆ SendJson()

int ola::http::HTTPResponse::SendJson | ( | const ola::web::JsonValue & | json | ) |

Send a JsonObject as the response.

Returns
  true on success, false on error

## ◆ SetContentType()

void ola::http::HTTPResponse::SetContentType | ( | const std::string & | type | ) |

Set the content-type header.

Parameters

  type | the content type

Returns
  true if the header was set correctly, false otherwise

## ◆ SetHeader()

void ola::http::HTTPResponse::SetHeader | ( | const std::string & | key,
|  | const std::string & | value )

Set a header in the response.

Parameters

  key | the header name
  value | the header value

Returns
  true if the header was set correctly, false otherwise

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

- include/ola/http/HTTPServer.h
- common/http/HTTPServer.cpp