Started rewrite of HTTPServer.

This commit is contained in:
EinMByte 2015-09-06 20:34:50 +02:00
parent 3d30b4bbbc
commit e7350a3af4
6 changed files with 269 additions and 1066 deletions

View file

@ -14,9 +14,9 @@ class Request {
void parseHeaderLine(const std::string& line);
public:
Request(const std::string& data);
Request() = default;
Request();
Request(const std::string& data);
std::string getMethod() const;
@ -41,8 +41,9 @@ private:
class Response {
public:
Response() = default;
Response(int status);
Response(int status, const std::string& content = "");
/**
* @note overrides existing header values with the same name
@ -57,8 +58,11 @@ public:
*/
std::string getStatusMessage() const;
void setContentLength();
private:
int status;
std::string content;
std::map<std::string, std::string> headers;
};