|
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 | set_code (Code code) |
| Set response code. More... | |
| void | add_header (const std::string &header, const std::string &content) |
| Add a HTTP header. More... | |
| void | add_header (const std::string &header_string) |
| Add a HTTP header. More... | |
| const HeaderMap & | headers () const |
| get headers. More... | |
| void | set_caching (bool caching) |
| Enable or disable caching for this specific reply. More... | |
| void | set_request (WebRequest *request) |
| Set associated request. More... | |
| WebRequest * | get_request () const |
| Get associated request. More... | |
| void | pack_caching () |
| Called just before the reply is sent. More... | |
Static Public Member Functions | |
| static void | set_caching_default (bool caching) |
| Enable or disable caching default for 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 | ( | const std::string & | header, |
| const std::string & | content | ||
| ) |
Add a HTTP header.
| header | header entry name |
| content | content of the header field |
Definition at line 123 of file reply.cpp.
Referenced by fawkes::DynamicFileWebReply::DynamicFileWebReply(), fawkes::DynamicMJPEGStreamWebReply::DynamicMJPEGStreamWebReply(), fawkes::DynamicMJPEGStreamWebReply::operator=(), MetricsRequestProcessor::process_request(), fawkes::WebPageReply::WebPageReply(), fawkes::WebRedirectReply::WebRedirectReply(), and fawkes::WebviewRestReply::WebviewRestReply().
| void fawkes::WebReply::add_header | ( | const std::string & | header_string | ) |
| WebReply::Code fawkes::WebReply::code | ( | ) | const |
Get response code.
Definition at line 104 of file reply.cpp.
Referenced by set_code(), fawkes::WebErrorPageReply::WebErrorPageReply(), and WebReply().
| WebRequest * fawkes::WebReply::get_request | ( | ) | const |
Get associated request.
This is only valid after set_request() has been called.
Definition at line 163 of file reply.cpp.
Referenced by fawkes::dynamic_reply_data_cb().
| const WebReply::HeaderMap & fawkes::WebReply::headers | ( | ) | const |
| void fawkes::WebReply::pack_caching | ( | ) |
| void fawkes::WebReply::set_caching | ( | bool | caching | ) |
Enable or disable caching for this specific reply.
| caching | true to enable client-side caching, false to disable |
Definition at line 95 of file reply.cpp.
Referenced by fawkes::no_caching().
|
static |
Enable or disable caching default for replies.
This static setting controls whether following replies will allow for client-side of the web pages or not by default. 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_code | ( | WebReply::Code | code | ) |
Set response code.
| code | HTTP response code |
Definition at line 113 of file reply.cpp.
References code().
Referenced by MetricsRequestProcessor::process_request().
| void fawkes::WebReply::set_request | ( | WebRequest * | request | ) |