#include <userver/clients/http/client.hpp>
HTTP client that returns a HTTP request builder from CreateRequest().
Usually retrieved from components::HttpClient component.
Definition at line 63 of file client.hpp.
Public Member Functions | |
Client (ClientSettings settings, engine::TaskProcessor &fs_task_processor, impl::PluginPipeline &&plugin_pipeline) | |
Request | CreateRequest () |
Returns a HTTP request builder type with preset values of User-Agent, Proxy and some of the Testsuite suff (if any). | |
Request | CreateNotSignedRequest () |
void | ResetUserAgent (std::optional< std::string > user_agent=std::nullopt) |
Sets User-Agent headers for all the requests or removes that header. | |
std::string | GetProxy () const |
Returns the current proxy that is automatically used for each request. | |
void | SetDnsResolver (clients::dns::Resolver *resolver) |
Sets the DNS resolver to use. | |
|
inline |
Providing CreateNonSignedRequest() function for the clients::Http alias.
Definition at line 78 of file client.hpp.
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).