roar
|
#include <response.hpp>
Public Types | |
using | body_type = BodyT |
Public Member Functions | |
Response () | |
Response (boost::beast::http::response< BodyT > &&res) | |
template<typename... Forwards> | |
Response (Forwards... forwards) | |
Response & | status (boost::beast::http::status status) |
Sets the response status code. | |
Response & | setCookie (Cookie const &cookie) |
Sets a set-cookie header entry. | |
auto & | body () |
Retrieve the response body object. | |
Response & | keepAlive (bool keepAlive=true) |
Set keep alive. | |
template<typename T > | |
Response & | body (T &&toAssign) |
This function can be used to assign something to the body. | |
auto | body () const |
Response & | chunked (bool activate=true) |
(De)Activate chunked encoding. | |
bool | chunked () const |
Response & | contentType (std::string const &type) |
For setting of the content type. | |
std::optional< std::string > | contentType () const |
Response & | contentLength (std::size_t length) |
std::optional< std::size_t > | contentLength () const |
auto | begin () |
auto | begin () const |
auto | end () |
auto | end () const |
auto | cbegin () const |
auto | cend () const |
auto | at (boost::beast::http::field field) const |
void | clear () |
auto | equal_range (boost::beast::http::field field) const |
auto | erase (boost::beast::http::field field) |
auto | find (boost::beast::http::field field) const |
bool | hasContentLength () const |
bool | hasField (boost::beast::http::field field) const |
bool | hasKeepAlive () const |
auto | payloadSize () const |
auto | reason () const |
auto | result () const |
auto | resultInt () const |
void | set (boost::beast::http::field field, std::string const &value) |
auto | target () const |
auto | version () const |
Response & | contentType (char const *type) |
For setting of the content type. | |
Response & | setHeader (boost::beast::http::field field, std::string const &value) |
Can be used to set a header field. | |
std::optional< std::string > | getHeader (boost::beast::http::field field) const |
Response & | setHeader (boost::beast::http::field field, char const *value) |
Can be used to set a header field. | |
Response & | preparePayload () |
Sets header values that are implicit by the body (like Content-Lenght). | |
template<typename RequestBodyT > | |
Response & | enableCors (Request< RequestBodyT > const &req, std::optional< CorsSettings > cors=std::nullopt) |
Sets cors headers. | |
Response & | enableCorsEverything () |
boost::beast::http::response< BodyT > && | response () && |
Ejects the underlying boost response. | |
boost::beast::http::response< BodyT > & | response () & |
Accessor for the underlying boost response. | |
Private Member Functions | |
auto | joinList (std::vector< std::string > const &list) |
Private Attributes | |
boost::beast::http::response< BodyT > | response_ |
using Roar::Response< BodyT >::body_type = BodyT |
|
inline |
|
inlineexplicit |
|
inlineexplicit |
|
inline |
|
inline |
|
inline |
|
inline |
Retrieve the response body object.
|
inline |
|
inline |
This function can be used to assign something to the body.
T |
toAssign |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Sets cors headers.
req | A request to base the cors headers off of. |
cors | A cors settings object. If not supplied, a very permissive setting is used. |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineprivate |
|
inline |
|
inline |
|
inline |
Sets header values that are implicit by the body (like Content-Lenght).
|
inline |
|
inline |
Accessor for the underlying boost response.
|
inline |
Ejects the underlying boost response.
|
inline |
|
inline |
|
inline |
|
inline |
Sets a set-cookie header entry.
cookie | A cookie. |
|
inline |
Can be used to set a header field.
|
inline |
Can be used to set a header field.
|
inline |
Sets the response status code.
status | A status code. |
|
inline |
|
inline |
|
private |