Table of Contents

Class HttpClientFactoryConfiguration

Namespace
Xping.Sdk.Core.Clients.Http
Assembly
Xping.Sdk.Core.dll

Represents configuration settings specific to HttpClient instances created by the IHttpClientFactory. These settings apply to the factory, and all HttpClient instances created by the factory will be constructed with these settings. Normally, these properties have predefined defaults; however, they can also be changed according to your requirements.

public class HttpClientFactoryConfiguration : BaseConfiguration
Inheritance
HttpClientFactoryConfiguration
Inherited Members

Fields

HttpClientAutoRedirects

This constant is set to false, indicating that the HttpClient will not follow redirection responses automatically. This allows the Xping to handle redirections manually.

public const bool HttpClientAutoRedirects = false

Field Value

bool

HttpClientHandleCookies

This constant is set to false, meaning that the HttpClient will not handle cookies automatically. This allows the Xping to manage cookies in a custom manner.

public const bool HttpClientHandleCookies = false

Field Value

bool

HttpClientWithNoRetryPolicy

The name of the HttpClient that does not perform any retry policies.

public const string HttpClientWithNoRetryPolicy = "HttpClientWithNoRetryPolicy"

Field Value

string

Remarks

This constant is used to create or resolve a named HttpClient in the DependencyInjection service collection.

HttpClientWithRetryPolicy

The name of the HttpClient that performs retry policies.

public const string HttpClientWithRetryPolicy = "HttpClientWithRetryPolicy"

Field Value

string

Remarks

This constant is used to create or resolve a named HttpClient in the DependencyInjection service collection.

Properties

AutomaticDecompression

Gets or sets a type of decompression method used by the _handler for automatic decompression of the HTTP content response. Default is All.

public DecompressionMethods AutomaticDecompression { get; set; }

Property Value

DecompressionMethods

DurationOfBreak

Gets or sets the duration the circuit will stay open before resetting. Default is 30[s]. See the remarks on PolicyHttpMessageHandler.

public TimeSpan DurationOfBreak { get; set; }

Property Value

TimeSpan

HandledEventsAllowedBeforeBreaking

Gets or sets the number of exceptions or handled results that are allowed before opening the circuit. See the remarks on PolicyHttpMessageHandler.

public int HandledEventsAllowedBeforeBreaking { get; set; }

Property Value

int

PooledConnectionLifetime

Gets or sets how long a connection can be in the pool to be considered reusable. Default is 1 minute. See the remarks on PooledConnectionLifetime.

public TimeSpan PooledConnectionLifetime { get; set; }

Property Value

TimeSpan

SleepDurations

Gets or sets the sleep durations to wait for on each retry. Default is 1[s] on 1st retry, 5[s] on 2nd retry and 10[s] on 3rd retry. See the remarks on PolicyHttpMessageHandler.

public IEnumerable<TimeSpan> SleepDurations { get; set; }

Property Value

IEnumerable<TimeSpan>