2015-08-30 07:12:46 +08:00
|
|
|
#ifndef MEMGRAPH_SERVER_HTTP_RESPONSE_HPP
|
|
|
|
#define MEMGRAPH_SERVER_HTTP_RESPONSE_HPP
|
|
|
|
|
|
|
|
#include <map>
|
|
|
|
|
2015-09-20 20:30:26 +08:00
|
|
|
#include "io/uv/uv.hpp"
|
2015-08-30 07:12:46 +08:00
|
|
|
#include "status_codes.hpp"
|
|
|
|
|
|
|
|
namespace http
|
|
|
|
{
|
|
|
|
|
|
|
|
class HttpConnection;
|
|
|
|
|
|
|
|
class Response
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Response(HttpConnection& connection);
|
|
|
|
|
|
|
|
void send(const std::string& body);
|
|
|
|
void send(Status code, const std::string& body);
|
|
|
|
|
|
|
|
Response& status(Status code);
|
|
|
|
|
|
|
|
std::map<std::string, std::string> headers;
|
|
|
|
|
|
|
|
private:
|
|
|
|
HttpConnection& connection;
|
|
|
|
uv::UvBuffer buffer;
|
|
|
|
|
|
|
|
Status code;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|