8#include <userver/clients/http/response.hpp>
9#include <userver/concurrent/queue.hpp>
10#include <userver/engine/deadline.hpp>
11#include <userver/engine/future.hpp>
13USERVER_NAMESPACE_BEGIN
15namespace clients::
http {
24class StreamedResponse
final {
26 StreamedResponse(StreamedResponse&&) =
default;
27 StreamedResponse(
const StreamedResponse&) =
delete;
29 StreamedResponse& operator=(StreamedResponse&&) =
default;
30 StreamedResponse& operator=(
const StreamedResponse&) =
delete;
39 std::string
GetHeader(
const std::string& header_name);
44 const Response::CookiesMap& GetCookies();
53 bool ReadChunk(std::string& output, engine::Deadline);
56 StreamedResponse(engine::Future<
void>&& headers_future,
57 Queue::Consumer&& queue_consumer,
58 std::shared_ptr<clients::
http::RequestState> request_state);
62 std::future_status WaitForHeaders(engine::Deadline);
64 void WaitForHeadersOrThrow(engine::Deadline);
66 std::shared_ptr<RequestState> request_state_;
68 std::shared_ptr<Response> response_;
69 engine::Deadline deadline_;
71 engine::Future<
void> headers_future_;
72 Queue::Consumer queue_consumer_;