From 1a8f351248c38445189a397035e8a2cb3182ea6a Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Mon, 27 Dec 2010 20:48:35 +0100 Subject: Added HTTPRequest and HTTPResponse classes. --- http.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 http.h (limited to 'http.h') diff --git a/http.h b/http.h new file mode 100644 index 0000000..f7aec59 --- /dev/null +++ b/http.h @@ -0,0 +1,27 @@ +#ifndef HTTP_H +#define HTTP_H + +#include +#include +#include + +typedef std::map HTTPHeaders; + +class HTTPRequest { + public: + std::string type, path, httpver; + HTTPHeaders headers; + HTTPRequest(std::istream& is); +}; + +class HTTPResponse { + public: + HTTPHeaders headers; + int code; + std::string httpver, status; + HTTPResponse(); + void add_header(std::string key, std::string value); + void write_headers(std::ostream& os); +}; + +#endif -- cgit v1.2.3