Table of Contents

Class HttpClientOptions

Namespace
Homa.Sdk.Foundation
Assembly
Homa.Sdk.Foundation.dll

Allows to provide configuration for instances of HttpClient returned by HttpClientFactory

public class HttpClientOptions
Inheritance
HttpClientOptions
Inherited Members

Properties

ExpireTime

How long until the HttpClient instance will be recycled. Default time is 15 minutes.

public TimeSpan ExpireTime { get; set; }

Property Value

TimeSpan

Handler

Custom message handler used by the client.

[Obsolete("Avoid providing a custom handler, if it can be modified during the same session. Use other options instead to construct handler. Use HandlerFactory to create it directly.")]
public HttpMessageHandler Handler { get; set; }

Property Value

HttpMessageHandler

HandlerFactory

Allows to provide a custom method which can create new HttpMessageHandler instance with custom options, while its being rotated by the HttpClientFactory. For instances of HttpClientHandler the HttpClientFactory automatically configures decompression and proxy support.

public Func<HttpMessageHandler> HandlerFactory { get; set; }

Property Value

Func<HttpMessageHandler>

Headers

Custom headers always added to the client.

public Dictionary<string, string> Headers { get; set; }

Property Value

Dictionary<string, string>

Timeout

Client-level timeout applied to every request sent through the client. When null, the HttpClient default of 100 seconds applies. Requests executed through IHttpRequest<T> manage their own timeout and are additionally bounded by this value, so set it to InfiniteTimeSpan (or above the largest request timeout) when requests need timeouts longer than the default.

public TimeSpan? Timeout { get; set; }

Property Value

TimeSpan?