|
template<typename... Forwards, typename RequestBodyT > |
| SendIntermediate (Session &session, Request< RequestBodyT > const &req, Forwards &&... forwards) |
|
| SendIntermediate (Session &session, boost::beast::http::response< BodyT > res) |
|
| SendIntermediate (Session &session, Response< BodyT > &&res) |
|
| SendIntermediate (Session &session) |
|
| SendIntermediate (SendIntermediate &&)=default |
|
| SendIntermediate (SendIntermediate const &)=delete |
|
SendIntermediate & | operator= (SendIntermediate &&)=default |
|
SendIntermediate & | operator= (SendIntermediate const &)=delete |
|
SendIntermediate & | status (boost::beast::http::status status) |
| Sets the response status code.
|
|
auto & | body () |
| Retrieve the response body object.
|
|
template<typename T > |
SendIntermediate & | body (T &&toAssign) |
| This function can be used to assign something to the body.
|
|
SendIntermediate & | chunked (bool activate=true) |
| (De)Activate chunked encoding.
|
|
template<typename T > |
SendIntermediate & | contentType (T &&type) |
| For setting of the content type.
|
|
template<typename T > |
SendIntermediate & | setHeader (boost::beast::http::field field, T &&value) |
| Can be used to set a header field.
|
|
template<typename T > |
SendIntermediate & | header (boost::beast::http::field field, T &&value) |
|
SendIntermediate & | onWriteSome (std::function< bool(std::size_t)> onChunkFunc) |
| Set a callback function that is called whenever some data was written.
|
|
template<typename RequestBodyT2 > |
SendIntermediate & | enableCors (Request< RequestBodyT2 > const &req, std::optional< CorsSettings > cors=std::nullopt) |
| Sets cors headers.
|
|
SendIntermediate & | preparePayload () |
|
SendIntermediate & | modifyResponse (std::function< void(Response< BodyT > &)> func) |
|
template<typename T = BodyT, bool OverrideSfinae = false> |
std::enable_if_t< !(std::is_same_v< T, RangeFileBody >||std::is_same_v< T, boost::beast::http::empty_body >)||OverrideSfinae, CommitReturnType > | commit () |
| Sends the response and invalidates this object.
|
|
template<typename T = BodyT> |
std::enable_if_t< std::is_same_v< T, boost::beast::http::empty_body >, CommitReturnType > | commit () |
| Sends the response and invalidates this object.
|
|
template<typename T = BodyT> |
std::enable_if_t< std::is_same_v< T, RangeFileBody >, CommitReturnType > | commit () |
| Sends the response for range request file bodies. Sets appropriate headers.
|
|
SendIntermediate & | rejectAuthorization (std::string const &wwwAuthenticate) |
| Sets WWW-Authenticate header and sets the status to unauthorized.
|
|
SendIntermediate & | keepAlive (bool keepAlive=true) |
| Set keep alive.
|
|
SendIntermediate & | setCookie (Cookie const &cookie) |
| Sets a cookie.
|
|
SendIntermediate & | useFixedTimeout (std::chrono::milliseconds timeout) |
| Set a timeout for the whole write operation.
|
|
template<typename BodyT>
class Roar::Session::SendIntermediate< BodyT >
Helper class to prepare and send a response.