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);
57 engine::Future<
void>&& headers_future,
58 Queue::Consumer&& queue_consumer,
59 std::shared_ptr<clients::
http::RequestState> request_state
64 std::future_status WaitForHeaders(engine::Deadline);
66 void WaitForHeadersOrThrow(engine::Deadline);
68 std::shared_ptr<RequestState> request_state_;
70 std::shared_ptr<Response> response_;
71 engine::Deadline deadline_;
73 engine::Future<
void> headers_future_;
74 Queue::Consumer queue_consumer_;