userver: server::http::ResponseBodyStream Class Reference
Loading...
Searching...
No Matches
server::http::ResponseBodyStream Class Referencefinal

#include <userver/server/http/http_response_body_stream.hpp>

Detailed Description

Streaming HTTP response body writer that is passed to server::handlers::HttpHandlerBase::HandleStreamRequest() overloads.

See also
HTTP, HTTPS, WebSocket

Definition at line 23 of file http_response_body_stream.hpp.

Public Member Functions

 ResponseBodyStream (ResponseBodyStream &&)=default
void PushBodyChunk (std::string &&chunk, engine::Deadline deadline)
void SetBody (std::string &&body)
 Set full response body instead of sending chunks; should not be called after PushBodyChunk().
void SetHeader (const std::string &, const std::string &)
void SetHeader (std::string_view, const std::string &)
void SetEndOfHeaders ()
void SetStatusCode (int status_code)
 Set the HTTP status code; should not be called after PushBodyChunk() as the result will be ignored.
void SetStatusCode (HttpStatus status)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Member Function Documentation

◆ PushBodyChunk()

void server::http::ResponseBodyStream::PushBodyChunk ( std::string && chunk,
engine::Deadline deadline )

Send a chunk of response data; should not be called after SetBody(). It may NOT generate exactly one HTTP chunk per call to PushBodyChunk().

◆ server::handlers::HttpHandlerBase

friend class server::handlers::HttpHandlerBase
friend

Definition at line 48 of file http_response_body_stream.hpp.


The documentation for this class was generated from the following file: