Fawkes API
Fawkes Development Version
|
23 #ifndef _LIBS_WEBVIEW_REPLY_H_
24 #define _LIBS_WEBVIEW_REPLY_H_
98 typedef std::map<std::string, std::string>
HeaderMap;
105 void add_header(
const std::string &header,
const std::string &content);
106 void add_header(
const std::string &header_string);
121 static bool caching_default_;
131 virtual size_t size() = 0;
132 virtual size_t next_chunk(
size_t pos,
char *buffer,
size_t buf_max_size) = 0;
144 virtual const std::string &
body();
REQUESTED_RANGE_NOT_SATISFIABLE.
HTTP_VERSION_NOT_SUPPORTED.
void set_code(Code code)
Set response code.
virtual size_t next_chunk(size_t pos, char *buffer, size_t buf_max_size)=0
virtual size_t chunk_size()
Chunksize.
void set_request(WebRequest *request)
Set associated request.
BANDWIDTH_LIMIT_EXCEEDED.
void set_caching(bool caching)
Enable or disable caching for this specific reply.
DynamicWebReply(Code code)
Constructor.
StaticWebReply & operator+=(std::string text)
Append simple text line.
virtual void pack()
Pack the data.
WebReply(Code code)
Constructor.
void pack_caching()
Called just before the reply is sent.
const HeaderMap & headers() const
get headers.
virtual std::string::size_type body_length()
Get length of body.
void append_body(const char *format,...)
Append to body.
PROXY_AUTHENTICATION_REQUIRED.
void add_header(const std::string &header, const std::string &content)
Add a HTTP header.
static void set_caching_default(bool caching)
Enable or disable caching default for replies.
std::map< std::string, std::string > HeaderMap
Map of headers.
WebReply * no_caching(WebReply *reply)
Disable caching on a reply.
virtual const std::string & body()
Get body.
Code code() const
Get response code.
std::string _body
Body of the reply.
NON_AUTHORITATIVE_INFORMATION.
WebRequest * get_request() const
Get associated request.
StaticWebReply(Code code, std::string body="")
Constructor.
virtual ~WebReply()
Destructor.
REQUEST_ENTITY_TOO_LARGE.