Public Types | Static Public Member Functions | Public Attributes
async_web_server_cpp::HttpReply Struct Reference

#include <http_reply.hpp>

List of all members.

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

Detailed Description

Utility methods for constructing replys

Definition at line 20 of file http_reply.hpp.


Member Enumeration Documentation

Enumerator:
switching_protocols 
ok 
created 
accepted 
no_content 
multiple_choices 
moved_permanently 
moved_temporarily 
not_modified 
bad_request 
unauthorized 
forbidden 
not_found 
internal_server_error 
not_implemented 
bad_gateway 
service_unavailable 

Definition at line 22 of file http_reply.hpp.


Member Function Documentation

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

Parameters:
path_rootthe prefix in the request path that should be ignored
filesystem_rootthe 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.

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.


Member Data Documentation


The documentation for this struct was generated from the following files:


async_web_server_cpp
Author(s): Mitchell Wills
autogenerated on Fri Mar 4 2016 11:30:14