Added basic webui (layout from l-n-s).

This commit is contained in:
EinMByte 2015-09-07 12:31:57 +02:00
parent e7350a3af4
commit 719bfbc89b
8 changed files with 512 additions and 16 deletions

View file

@ -26,8 +26,13 @@ Request::Request(const std::string& data)
std::getline(ss, line);
parseRequestLine(line);
while(std::getline(ss, line))
while(std::getline(ss, line) && !boost::trim_copy(line).empty())
parseHeaderLine(line);
if(ss) {
const std::string current = ss.str();
content = current.substr(ss.tellg());
}
}
std::string Request::getMethod() const
@ -55,6 +60,11 @@ std::string Request::getHeader(const std::string& name) const
return headers.at(name);
}
std::string Request::getContent() const
{
return content;
}
Response::Response(int status, const std::string& content)
: status(status), content(content), headers()
{

View file

@ -31,10 +31,13 @@ public:
*/
std::string getHeader(const std::string& name) const;
std::string getContent() const;
private:
std::string method;
std::string uri;
std::string host;
std::string content;
int port;
std::map<std::string, std::string> headers;
};