userver: clients::http::StreamedResponse Class Reference
⚠️ This is the documentation for an old userver version. Click here to switch to the latest version.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
clients::http::StreamedResponse Class Referencefinal

#include <userver/clients/http/streamed_response.hpp>

Detailed Description

HTTP response for streamed API.

Call Request::async_perform_stream_body() to get one. You can use it for fast proxying backend response body to a remote Application.

Definition at line 24 of file streamed_response.hpp.

Public Types

using Queue = concurrent::StringStreamQueue
 

Public Member Functions

 StreamedResponse (StreamedResponse &&)=default
 
 StreamedResponse (const StreamedResponse &)=delete
 
StreamedResponseoperator= (StreamedResponse &&)=default
 
StreamedResponseoperator= (const StreamedResponse &)=delete
 
Status StatusCode ()
 HTTP status code.
 
std::string GetHeader (const std::string &header_name)
 
const HeadersGetHeaders ()
 
const Response::CookiesMap & GetCookies ()
 
bool ReadChunk (std::string &output, engine::Deadline)
 

Member Typedef Documentation

◆ Queue

Member Function Documentation

◆ GetHeader()

std::string clients::http::StreamedResponse::GetHeader ( const std::string & header_name)

Returns HTTP header value by its name (case-insensitive) A missing key results in empty string

Note
may suspend the coroutine if headers are not obtained yet.

◆ GetHeaders()

const Headers & clients::http::StreamedResponse::GetHeaders ( )

Get all HTTP headers as a case-insensitive unordered map

Note
may suspend the coroutine if headers are not obtained yet.

◆ ReadChunk()

bool clients::http::StreamedResponse::ReadChunk ( std::string & output,
engine::Deadline  )

Read another HTTP response body part into 'output'. Any previous data in 'output' is dropped.

Note
The chunk size is not guaranteed to be exactly multipart/form-data chunk size or any other HTTP-related size
may block if the chunk is not obtained yet.

◆ StatusCode()

Status clients::http::StreamedResponse::StatusCode ( )

HTTP status code.

Note
may suspend the coroutine if the code is not obtained yet.

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