userver: clients::http Namespace Reference
Loading...
Searching...
No Matches
clients::http Namespace Reference

Detailed Description

HTTP client helpers.

Classes

class  AuthFailedException
 
class  BadArgumentException
 
class  BaseCodeException
 Exception with string and error_code. More...
 
class  BaseException
 Exception with string. More...
 
class  CancelException
 
class  Client
 HTTP client interface that returns a HTTP request builder from CreateRequest(). More...
 
class  ClientCore
 HTTP client that returns a HTTP request builder from CreateRequest(). More...
 
struct  ClientSettings
 
class  ClientWithMiddlewares
 HTTP client that returns a HTTP request builder from CreateRequest() with applied middlewares. More...
 
class  ConnectTo
 CURLOPT_CONNECT_TO argument for curl's connect_to(). More...
 
struct  DeadlinePropagationConfig
 
class  DNSProblemException
 
class  Form
 
class  HttpClientException
 
class  HttpException
 Base class for HttpClientException and HttpServerException. More...
 
class  HttpServerException
 
struct  LocalStats
 Represents all the local timings and statistics. More...
 
class  MiddlewareBase
 Base class for HTTP Client middlewares. More...
 
class  MiddlewarePipelineComponent
 Component that provides list of common middlewares names for all components::HttpClient instances. More...
 
class  MiddlewareRequest
 Auxiliary entity that allows editing request to a client from middlewares. More...
 
class  NetworkProblemException
 
class  Request
 Class for creating and performing new http requests, usually retieved from clients::http::Client. More...
 
class  Response
 Class that will be returned for successful request. More...
 
class  ResponseFuture
 Allows to perform a request concurrently with other work without creating an extra coroutine for waiting. More...
 
class  SSLException
 
struct  StandaloneConfig
 
class  StreamedResponse
 HTTP response for streamed API. More...
 
class  TechnicalError
 
class  TimeoutException
 
class  TooManyRedirectsException
 

Typedefs

using Status = ::http::StatusCode
 
using Headers = ::http::headers::HeaderMap
 Headers container type.
 

Enumerations

enum class  HttpMethod {
  kGet ,
  kPost ,
  kHead ,
  kPut ,
  kDelete ,
  kPatch ,
  kOptions
}
 HTTP request method. More...
 
enum class  HttpAuthType {
  kBasic ,
  kDigest ,
  kDigestIE ,
  kNegotiate ,
  kNtlm ,
  kNtlmWb ,
  kAny ,
  kAnySafe
}
 HTTP Authorization types. More...
 
enum class  ProxyAuthType {
  kBasic ,
  kDigest ,
  kDigestIE ,
  kBearer ,
  kNegotiate ,
  kNtlm ,
  kNtlmWb ,
  kAny ,
  kAnySafe
}
 HTTP Proxy Authorization types. More...
 
enum class  ErrorKind {
  kNetwork ,
  kDeadlinePropagation ,
  kTimeout ,
  kCancel ,
  kClient ,
  kServer
}
 Additional tag to the exception. More...
 
enum class  CancellationPolicy {
  kIgnore ,
  kCancel
}
 

Functions

std::string_view ToStringView (HttpMethod method)
 Convert HTTP method enum value to string.
 
HttpMethod HttpMethodFromString (std::string_view method_str)
 Convert HTTP method string to enum value.
 
ProxyAuthType ProxyAuthTypeFromString (std::string_view auth_name)
 
std::exception_ptr PrepareException (std::error_code ec, std::string_view url, const LocalStats &stats)
 map error_code to exceptions
 
CancellationPolicy Parse (yaml_config::YamlConfig value, formats::parse::To< CancellationPolicy >)
 
components::ComponentList ComponentList ()
 Returns list of components required to use HTTP client.
 
ClientSettings Parse (const yaml_config::YamlConfig &value, formats::parse::To< ClientSettings >)
 
std::shared_ptr< ClientCreateStandaloneHttpClient (ClientSettings settings, StandaloneConfig standalone_config, engine::TaskProcessor &fs_task_processor, std::vector< utils::NotNull< clients::http::MiddlewareBase * > > middlewares={})
 Creates HTTP client with given settings and middlewares.
 

Typedef Documentation

◆ Headers

Headers container type.

Definition at line 22 of file response.hpp.

◆ Status

Definition at line 19 of file response.hpp.

Enumeration Type Documentation

◆ CancellationPolicy

enum class clients::http::CancellationPolicy
strong

Definition at line 9 of file cancellation_policy.hpp.

◆ ErrorKind

enum class clients::http::ErrorKind
strong

Additional tag to the exception.

Definition at line 11 of file error_kind.hpp.

◆ HttpAuthType

enum class clients::http::HttpAuthType
strong

HTTP Authorization types.

Enumerator
kBasic 

"basic"

kDigest 

"digest"

kDigestIE 

"digest_ie"

kNegotiate 

"negotiate"

kNtlm 

"ntlm"

kNtlmWb 

"ntlm_wb"

kAny 

"any"

kAnySafe 

"any_safe"

Definition at line 61 of file request.hpp.

◆ HttpMethod

enum class clients::http::HttpMethod
strong

HTTP request method.

Definition at line 50 of file request.hpp.

◆ ProxyAuthType

enum class clients::http::ProxyAuthType
strong

HTTP Proxy Authorization types.

Enumerator
kBasic 

"basic"

kDigest 

"digest"

kDigestIE 

"digest_ie"

kBearer 

"bearer"

kNegotiate 

"negotiate"

kNtlm 

"ntlm"

kNtlmWb 

"ntlm_wb"

kAny 

"any"

kAnySafe 

"any_safe"

Definition at line 73 of file request.hpp.