5 #ifndef ZEROEQ_HTTP_RESPONSE_H 6 #define ZEROEQ_HTTP_RESPONSE_H 32 PARTIAL_CONTENT = 206,
33 MULTIPLE_CHOICES = 300,
34 MOVED_PERMANENTLY = 301,
35 MOVED_TEMPORARILY = 302,
43 REQUEST_TIMEOUT = 408,
44 PRECONDITION_FAILED = 412,
45 UNSATISFIABLE_RANGE = 416,
46 INTERNAL_SERVER_ERROR = 500,
47 NOT_IMPLEMENTED = 501,
49 SERVICE_UNAVAILABLE = 503,
50 SPACE_UNAVAILABLE = 507
69 const std::string& body_ = std::string())
77 const std::string& contentType)
80 , headers{{Header::CONTENT_TYPE, contentType}}
86 std::map<Header, std::string> headers_)
89 , headers{{std::move(headers_)}}
std::string body
Payload to return in a format specified in CONTENT_TYPE header.
Response(const Code code_, const std::string &body_, std::map< Header, std::string > headers_)
Construct a Response with a given code, payload and map of headers.
Code
HTTP codes to be used in a Response.
Response to an HTTP Request.
Header
HTTP headers which can be used in a Response.
Response(const Code code_=Code::OK, const std::string &body_=std::string())
Construct a Response with a given return code and payload.
Code code
HTTP return code.
std::map< Header, std::string > headers
HTTP message headers.
Publish-subscribe and request-reply.
Response(const Code code_, const std::string &body_, const std::string &contentType)
Construct a Response with a given code, payload and content type.