memgraph/speedy/http/response.hpp

39 lines
665 B
C++
Raw Normal View History

#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"
#include "status_codes.hpp"
namespace http
{
2015-10-09 07:24:12 +08:00
template <class Req, class Res>
class HttpConnection;
2015-10-09 07:24:12 +08:00
template <class Req, class Res>
class Response
{
2015-10-09 07:24:12 +08:00
using connection_t = HttpConnection<Req, Res>;
using response_t = Response<Req, Res>;
public:
2015-10-09 07:24:12 +08:00
Response(connection_t& connection);
void send(const std::string& body);
void send(Status code, const std::string& body);
std::map<std::string, std::string> headers;
2015-10-09 07:24:12 +08:00
Status status;
private:
2015-10-09 07:24:12 +08:00
connection_t& connection;
uv::UvBuffer buffer;
};
}
#endif