summaryrefslogtreecommitdiff
path: root/http.h
blob: f7aec594eb2e17255e2f2324759195b37e16613b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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