Class HttpClientFactory (1.50.0)

public class HttpClientFactory : object, IHttpClientFactory

The default implementation of the HTTP client factory.

Inheritance

Object > HttpClientFactory

Implements

IHttpClientFactory

Namespace

Google.Apis.Http

Assembly

Google.Apis.Core.dll

Methods

CreateClientHandler()

protected virtual HttpClientHandler CreateClientHandler()

Create a for use when communicating with the server. Please read the remarks closely before overriding this method.

Returns
TypeDescription
HttpClientHandler

A suitable .

Remarks

When overriding this method, please observe the following:

  • and of the returned instance are configured after this method returns. Configuring these within this method will have no effect.
  • Return a new instance of an for each call to this method.
  • This method may be called once, or more than once, when initializing a single client service.

CreateHandler(CreateHttpClientArgs)

protected virtual HttpMessageHandler CreateHandler(CreateHttpClientArgs args)

Creates a HTTP message handler. Override this method to mock a message handler.

Parameter
NameDescription
argsCreateHttpClientArgs
Returns
TypeDescription
HttpMessageHandler

CreateHttpClient(CreateHttpClientArgs)

public ConfigurableHttpClient CreateHttpClient(CreateHttpClientArgs args)

Creates a new configurable HTTP client.

Parameter
NameDescription
argsCreateHttpClientArgs
Returns
TypeDescription
ConfigurableHttpClient

Extension Method