#include <http_reply.hpp>
Public Types | |
enum | status_type { switching_protocols = 101, ok = 200, created = 201, accepted = 202, no_content = 204, multiple_choices = 300, moved_permanently = 301, moved_temporarily = 302, not_modified = 304, bad_request = 400, unauthorized = 401, forbidden = 403, not_found = 404, internal_server_error = 500, not_implemented = 501, bad_gateway = 502, service_unavailable = 503 } |
Static Public Member Functions | |
static ReplyBuilder | builder (status_type status) |
static HttpServerRequestHandler | from_file (HttpReply::status_type status, const std::string &content_type, const std::string &filename, const std::vector< HttpHeader > &additional_headers=std::vector< HttpHeader >()) |
static HttpServerRequestHandler | static_reply (status_type status, const std::string &content_type, const std::string &content, const std::vector< HttpHeader > &additional_headers=std::vector< HttpHeader >()) |
static HttpServerRequestHandler | stock_reply (status_type status) |
static std::vector < boost::asio::const_buffer > | to_buffers (const std::vector< HttpHeader > &headers) |
Public Attributes | |
enum async_web_server_cpp::HttpReply::status_type | status |
Utility methods for constructing replys
Definition at line 19 of file http_reply.hpp.
Definition at line 21 of file http_reply.hpp.
ReplyBuilder async_web_server_cpp::HttpReply::builder | ( | HttpReply::status_type | status | ) | [static] |
Create a builder to create and send reply headers
Definition at line 292 of file http_reply.cpp.
HttpServerRequestHandler async_web_server_cpp::HttpReply::from_file | ( | HttpReply::status_type | status, |
const std::string & | content_type, | ||
const std::string & | filename, | ||
const std::vector< HttpHeader > & | additional_headers = std::vector<HttpHeader>() |
||
) | [static] |
Create a request handler that sends the contents of a file NOTE: the file is only loaded once when the request handler is created
Definition at line 254 of file http_reply.cpp.
HttpServerRequestHandler async_web_server_cpp::HttpReply::static_reply | ( | HttpReply::status_type | status, |
const std::string & | content_type, | ||
const std::string & | content, | ||
const std::vector< HttpHeader > & | additional_headers = std::vector<HttpHeader>() |
||
) | [static] |
Create a request handler that sends a static response
Definition at line 264 of file http_reply.cpp.
HttpServerRequestHandler async_web_server_cpp::HttpReply::stock_reply | ( | HttpReply::status_type | status | ) | [static] |
Create a request handler that sends a stock reply based on the stats code
Definition at line 249 of file http_reply.cpp.
std::vector< boost::asio::const_buffer > async_web_server_cpp::HttpReply::to_buffers | ( | const std::vector< HttpHeader > & | headers | ) | [static] |
Definition at line 233 of file http_reply.cpp.