public class HttpClientFactory : object, IHttpClientFactoryThe default implementation of the HTTP client factory.
Implements
IHttpClientFactoryNamespace
Google.Apis.HttpAssembly
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 | |
|---|---|
| Type | Description |
HttpClientHandler |
A suitable . |
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 | |
|---|---|
| Name | Description |
args |
CreateHttpClientArgs |
| Returns | |
|---|---|
| Type | Description |
HttpMessageHandler |
|
CreateHttpClient(CreateHttpClientArgs)
public ConfigurableHttpClient CreateHttpClient(CreateHttpClientArgs args)Creates a new configurable HTTP client.
| Parameter | |
|---|---|
| Name | Description |
args |
CreateHttpClientArgs |
| Returns | |
|---|---|
| Type | Description |
ConfigurableHttpClient |
|