asio 0.3.8rc3 | Home | Reference | Tutorial | Examples | Design

Examples |

# http/server/reply.hpp

Go to the documentation of this file.

    00001 //
    00002 // reply.hpp
    00003 // ~~~~~~~~~
    00004 //
    00005 // Copyright (c) 2003-2007 Christopher M. Kohlhoff (chris at kohlhoff dot com)
    00006 //
    00007 // Distributed under the Boost Software License, Version 1.0. (See accompanying
    00008 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
    00009 //
    00010
    00011 #ifndef HTTP_REPLY_HPP
    00012 #define HTTP_REPLY_HPP
    00013
    00014 #include <string>
    00015 #include <vector>
    00016 #include <asio.hpp>
    00017 #include "header.hpp"
    00018
    00019 namespace http {
    00020 namespace server {
    00021
    00023 struct reply
    00024 {
    00026   enum status_type
    00027   {
    00028     ok = 200,
    00029     created = 201,
    00030     accepted = 202,
    00031     no_content = 204,
    00032     multiple_choices = 300,
    00033     moved_permanently = 301,
    00034     moved_temporarily = 302,
    00035     not_modified = 304,
    00036     bad_request = 400,
    00037     unauthorized = 401,
    00038     forbidden = 403,
    00039     not_found = 404,
    00040     internal_server_error = 500,
    00041     not_implemented = 501,
    00042     bad_gateway = 502,
    00043     service_unavailable = 503
    00044   } status;
    00045
    00047   std::vector<header> headers;
    00048
    00050   std::string content;
    00051
    00055   std::vector<asio::const_buffer> to_buffers();
    00056
    00058   static reply stock_reply(status_type status);
    00059 };
    00060
    00061 } // namespace server
    00062 } // namespace http
    00063
    00064 #endif // HTTP_REPLY_HPP

asio 0.3.8rc3 | Home | Reference | Tutorial | Examples | Design