5 // Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com)
7 // Distributed under the Boost Software License, Version 1.0. (See accompanying
8 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
11 #ifndef HTTP_SERVER2_REPLY_HPP
12 #define HTTP_SERVER2_REPLY_HPP
16 #include <boost/asio.hpp>
22 /// A reply to be sent to a client.
25 /// The status of the reply.
32 multiple_choices = 300,
33 moved_permanently = 301,
34 moved_temporarily = 302,
40 internal_server_error = 500,
41 not_implemented = 501,
43 service_unavailable = 503
46 /// The headers to be included in the reply.
47 std::vector<header> headers;
49 /// The content to be sent in the reply.
52 /// Convert the reply into a vector of buffers. The buffers do not own the
53 /// underlying memory blocks, therefore the reply object must remain valid and
54 /// not be changed until the write operation has completed.
55 std::vector<boost::asio::const_buffer> to_buffers();
57 /// Get a stock reply.
58 static reply stock_reply(status_type status);
61 } // namespace server2
64 #endif // HTTP_SERVER2_REPLY_HPP