summaryrefslogtreecommitdiff
path: root/http.h
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2010-12-27 20:48:35 +0100
committerJon Bergli Heier <snakebite@jvnv.net>2010-12-27 20:48:35 +0100
commit1a8f351248c38445189a397035e8a2cb3182ea6a (patch)
tree507c96dc5fc1e158f799cdeb13cfab382a7a0534 /http.h
parent263097e22bdf0a56007644e4d19605371dc79a8f (diff)
Added HTTPRequest and HTTPResponse classes.
Diffstat (limited to 'http.h')
-rw-r--r--http.h27
1 files changed, 27 insertions, 0 deletions
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 <iostream>
+#include <string>
+#include <map>
+
+typedef std::map<std::string, std::string> 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