22 #ifndef HTTP_REQUEST_HPP 23 #define HTTP_REQUEST_HPP 33 class HttpRequest :
public boost::enable_shared_from_this<HttpRequest>,
private boost::noncopyable
83 std::vector<boost::asio::const_buffer> toBuffers();
87 explicit HttpRequest ( boost::asio::io_service &ioService,
const shared_ptr<HttpServer>&
server,
const shared_ptr<RequestManager> &
manager );
99 boost::asio::ip::tcp::socket &
getSocket();
102 void handleRead (
const boost::system::error_code &e, std::size_t bytes_transferred );
105 void handleWrite (
const boost::system::error_code &e );
weak_ptr< HttpServer > server
Parser for incoming requests.
Reply reply
The reply to be sent back to the client.
const std::string forbidden
void handleRead(const boost::system::error_code &e, std::size_t bytes_transferred)
Handle completion of a read operation.
const std::string created
HttpRequest(boost::asio::io_service &ioService, const shared_ptr< HttpServer > &server, const shared_ptr< RequestManager > &manager)
This file is part of alaCarte.
std::array< char, 8192 > buffer
Buffer for incoming data.
const std::string accepted
std::vector< Header > headers
The headers to be included in the Reply.
TESTABLE const string & getURL() const
std::vector< Header > headers
boost::asio::ip::tcp::socket socket
Socket for the connection.
const std::string not_found
void handleWrite(const boost::system::error_code &e)
Handle completion of a write operation.
HttpRequestParser parser
The parser for the incoming request.
A HttpServer waits for connections and creates HttpRequests.
const std::string bad_gateway
std::string content
The content to be sent in the Reply.
const std::string not_implemented
const std::string not_modified
const std::string bad_request
void startCollectingData()
Start the first asynchronous operation for the connection.
void close()
Stop all asynchronous operations associated with the connection.
StatusType status
The Status of the Reply.
const std::string unauthorized
weak_ptr< RequestManager > manager
const std::string internal_server_error
boost::asio::ip::tcp::socket & getSocket()
shared_ptr< Tile > tile
The Tile to be sent in the Reply.
const std::string moved_temporarily
const std::string multiple_choices
const std::string no_content
const std::string moved_permanently
const std::string service_unavailable