HTTP client that returns a HTTP request builder from CreateRequest(). More...
#include <userver/clients/http/client.hpp>
Public Member Functions | |
Client (ClientSettings settings, engine::TaskProcessor &fs_task_processor, impl::PluginPipeline &&plugin_pipeline) | |
std::shared_ptr< Request > | CreateRequest () |
Returns a HTTP request builder type with preset values of User-Agent, Proxy and some of the Testsuite suff (if any). More... | |
std::shared_ptr< Request > | CreateNotSignedRequest () |
void | ResetUserAgent (std::optional< std::string > user_agent=std::nullopt) |
Sets User-Agent headers for all the requests or removes that header. More... | |
std::string | GetProxy () const |
Returns the current proxy that is automatically used for each request. More... | |
void | SetDnsResolver (clients::dns::Resolver *resolver) |
Sets the DNS resolver to use. More... | |
void | SetTracingManager (const tracing::TracingManagerBase &) |
HTTP client that returns a HTTP request builder from CreateRequest().
Usually retrieved from components::HttpClient component.
Definition at line 79 of file client.hpp.
|
inline |
Providing CreateNonSignedRequest() function for the clients::Http alias.
Definition at line 94 of file client.hpp.
std::shared_ptr< Request > clients::http::Client::CreateRequest | ( | ) |
Returns a HTTP request builder type with preset values of User-Agent, Proxy and some of the Testsuite suff (if any).
std::string clients::http::Client::GetProxy | ( | ) | const |
Returns the current proxy that is automatically used for each request.
void clients::http::Client::ResetUserAgent | ( | std::optional< std::string > | user_agent = std::nullopt | ) |
Sets User-Agent headers for all the requests or removes that header.
By default User-Agent is set by components::HttpClient to the userver identity string.
void clients::http::Client::SetDnsResolver | ( | clients::dns::Resolver * | resolver | ) |
Sets the DNS resolver to use.
If given nullptr, the default resolver will be used (most likely getaddrinfo).