8#include <userver/server/http/http_request.hpp>
10USERVER_NAMESPACE_BEGIN
12namespace server::
http {
15class HttpRequestBuilder
final {
18 explicit HttpRequestBuilder(
request::ResponseDataAccounter& data_accounter);
23 explicit HttpRequestBuilder(
const HttpRequest& data_accounter);
25 HttpRequestBuilder& SetRemoteAddress(engine::
io::Sockaddr remote_address);
27 HttpRequestBuilder& SetMethod(HttpMethod method);
29 HttpRequestBuilder& SetHttpMajor(
int http_major);
31 HttpRequestBuilder& SetHttpMinor(
int http_minor);
33 HttpRequestBuilder& SetBody(std::string&& body);
35 HttpRequestBuilder& AddHeader(std::string&& header, std::string&& value);
37 HttpRequestBuilder& AddRequestArg(std::string&& key, std::string&& value);
39 HttpRequestBuilder& SetPathArgs(std::vector<std::pair<std::string, std::string>> args);
41 HttpRequestBuilder& SetUrl(std::string&& url);
43 HttpRequestBuilder& SetRequestPath(std::string&& path);
45 std::shared_ptr<HttpRequest> Build();
48 HttpRequestBuilder& SetIsFinal(
bool is_final);
50 HttpRequestBuilder& SetFormDataArgs(
51 utils::impl::TransparentMap<std::string, std::vector<FormDataArg>, utils::StrCaseHash>&& form_data_args
54 HttpRequestBuilder& SetHttpHandler(
const handlers::
HttpHandlerBase& handler);
56 HttpRequestBuilder& SetTaskProcessor(engine::TaskProcessor& task_processor);
58 HttpRequestBuilder& SetHttpHandlerStatistics(handlers::HttpRequestStatistics& stats);
61 HttpRequestBuilder& SetStreamProducer(impl::Http2StreamEventProducer&& producer);
64 HttpRequestBuilder& SetResponseStreamId(std::int32_t stream_id);
66 HttpRequestBuilder& SetResponseStatus(HttpStatus status);
68 const HttpRequest& GetRef()
const;
70 HttpResponse& GetHttpResponse();
76 std::shared_ptr<HttpRequest> request_;