Fawkes API
Fawkes Development Version
|
Basic web reply. More...
#include <>>
Public Member Functions | |
WebReply (Code code) | |
Constructor. More... | |
virtual | ~WebReply () |
Destructor. More... | |
Code | code () const |
Get response code. More... | |
void | add_header (std::string header, std::string content) |
Add a HTTP header. More... | |
void | add_header (std::string header_string) |
Add a HTTP header. More... | |
const HeaderMap & | headers () const |
get headers. More... | |
void | set_request (WebRequest *request) |
Set associated request. More... | |
WebRequest * | get_request () const |
Get associated request. More... | |
Static Public Member Functions | |
static void | set_caching (bool caching) |
Enable or disable caching for all consecutive replies. More... | |
Basic web reply.
The base class for all web replies. Though the WebRequestDispatcher expects sub-classes of StaticWebReply or DynamicWebReply.
typedef std::map<std::string, std::string> fawkes::WebReply::HeaderMap |
HTTP response code.
fawkes::WebReply::WebReply | ( | Code | code | ) |
void fawkes::WebReply::add_header | ( | std::string | header, |
std::string | content | ||
) |
Add a HTTP header.
header | header entry name |
content | content of the header field |
Definition at line 97 of file reply.cpp.
Referenced by fawkes::dynamic_reply_free_cb(), fawkes::DynamicFileWebReply::DynamicFileWebReply(), fawkes::DynamicMJPEGStreamWebReply::DynamicMJPEGStreamWebReply(), ROSWebviewRequestProcessor::process_request(), WebviewPtzCamRequestProcessor::process_request(), fawkes::WebPageReply::WebPageReply(), and fawkes::WebRedirectReply::WebRedirectReply().
void fawkes::WebReply::add_header | ( | std::string | header_string | ) |
WebReply::Code fawkes::WebReply::code | ( | ) | const |
Get response code.
Definition at line 86 of file reply.cpp.
Referenced by fawkes::dynamic_reply_free_cb(), fawkes::WebPageReply::pack(), and WebReply().
WebRequest * fawkes::WebReply::get_request | ( | ) | const |
Get associated request.
This is only valid after set_request() has been called.
Definition at line 140 of file reply.cpp.
Referenced by fawkes::dynamic_reply_data_cb(), and fawkes::dynamic_reply_free_cb().
const WebReply::HeaderMap & fawkes::WebReply::headers | ( | ) | const |
get headers.
Definition at line 129 of file reply.cpp.
Referenced by fawkes::dynamic_reply_free_cb().
|
static |
Enable or disable caching for all consecutive replies.
This static setting controls whether following replies will allow for client-side of the web pages or not. Disabling this allows to force clients to always reload the pages.
caching | true to enable client-side caching, false to disable |
void fawkes::WebReply::set_request | ( | WebRequest * | request | ) |
Set associated request.
request | associated request |
Definition at line 150 of file reply.cpp.
Referenced by fawkes::dynamic_reply_free_cb().