diff options
author | Vegard Storheil Eriksen <zyp@jvnv.net> | 2011-01-02 22:28:26 +0100 |
---|---|---|
committer | Vegard Storheil Eriksen <zyp@jvnv.net> | 2011-01-02 22:28:26 +0100 |
commit | 0e3c3380d519b033500b4ed1ccd3acf707c34372 (patch) | |
tree | 115cbbf0200fc34011e68b32e56d58458a72d87f /http.h | |
parent | 237c3e226b7c2ac391b0e8d354e5fc6f587a41ba (diff) |
Merge HTTPResponse into HTTP::Connection.
Diffstat (limited to 'http.h')
-rw-r--r-- | http.h | 38 |
1 files changed, 0 insertions, 38 deletions
@@ -1,38 +0,0 @@ -#ifndef HTTP_H -#define HTTP_H - -#include <boost/asio.hpp> - -#include <iostream> -#include <string> -#include <map> - -typedef std::map<std::string, std::string> stringmap; -typedef stringmap HTTPHeaders; -typedef stringmap HTTPQuery; - -class HTTPRequest { - public: - std::string type, path, httpver; - HTTPQuery query; - HTTPHeaders headers; - HTTPRequest(std::istream& is); - static void url_decode(std::string& str); -}; - -class HTTPResponse { - private: - HTTPHeaders headers; - boost::asio::ip::tcp::socket& socket; - void write_headers(); - bool headers_written; - public: - int code; - std::string httpver, status; - HTTPResponse(boost::asio::ip::tcp::socket& socket_); - void add_header(std::string key, std::string value); - void write(char *data, unsigned int len); - void write(std::string str); -}; - -#endif |