#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 | from_filesystem (HttpReply::status_type status, const std::string &path_root, const std::string &filesystem_root, bool list_directories, 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 20 of file http_reply.hpp.
Definition at line 22 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 392 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
Definition at line 249 of file http_reply.cpp.
HttpServerRequestHandler async_web_server_cpp::HttpReply::from_filesystem | ( | HttpReply::status_type | status, |
const std::string & | path_root, | ||
const std::string & | filesystem_root, | ||
bool | list_directories, | ||
const std::vector< HttpHeader > & | additional_headers = std::vector<HttpHeader>() |
||
) | [static] |
Create a request handler that reads files from the filesystem No content type is served and it is left to the browser to determine the content type
path_root | the prefix in the request path that should be ignored |
filesystem_root | the path to search for the requested file |
Definition at line 286 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 363 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 358 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.