Class DependencyInjectionSettings
- Namespace
- Refitter.Core
- Assembly
- Refitter.Core.dll
Dependency Injection settings describing how the Refit client should be configured. This can be used to configure the HttpClient pipeline with additional handlers
public class DependencyInjectionSettings
- Inheritance
-
DependencyInjectionSettings
- Inherited Members
Fields
DefaultExtensionMethodName
Default name for the extension method used for configuring Refit clients.
public const string DefaultExtensionMethodName = "ConfigureRefitClients"
Field Value
Properties
BaseUrl
Base Address for the HttpClient
public string? BaseUrl { get; set; }
Property Value
ExtensionMethodName
Name of IServiceCollection Extension Method. Default is ConfigureRefitClients, or ConfigureApizrManagers if ApizrSettings property is set
public string ExtensionMethodName { get; set; }
Property Value
FirstBackoffRetryInSeconds
The median delay to target before the first retry in seconds. Default is 1 second
public double FirstBackoffRetryInSeconds { get; set; }
Property Value
HttpMessageHandlers
A collection of HttpMessageHandlers to be added to the HttpClient pipeline. This can be for telemetry logging, authorization, etc.
public string[] HttpMessageHandlers { get; set; }
Property Value
- string[]
MaxRetryCount
Default max retry count for transient error handling. Default is 6.
public int MaxRetryCount { get; set; }
Property Value
PollyMaxRetryCount
Default max retry count for transient error handling. Default is 6. This is deprecated. Use MaxRetryCount instead.
[Obsolete("Use MaxRetryCount instead")]
[ExcludeFromCodeCoverage]
public int PollyMaxRetryCount { get; set; }
Property Value
TransientErrorHandler
Library to use for transient error handling Options:
- None
- Polly - Polly Framework and HTTP Extensions
- HttpResilience - Microsoft HTTP Resilience Library
[JsonConverter(typeof(JsonStringEnumConverter))]
public TransientErrorHandler TransientErrorHandler { get; set; }
Property Value
UseGeneratedRefitClient
Gets or sets a value indicating whether the source-generated AddRefitGeneratedClient registration should be used instead of the reflection-based AddRefitClient. Requires Refit 12.1.0 or newer, and Refit 14.0.0 or newer if the interfaces have query parameters. With Refit 17 or newer, AddRefitClient needs the Refit.HttpClientFactory.Reflection package, and AddRefitGeneratedClient needs a JsonSerializerContext passed through RefitSettings. The source generator enables this automatically for Refit 17 or newer unless the project references Refit.HttpClientFactory.Reflection. Ignored when Apizr registration is generated. Default is false.
public bool UseGeneratedRefitClient { get; set; }
Property Value
UsePolly
Set this to true to use Polly for transient fault handling. This is deprecated. Use TransientErrorHandler instead.
[Obsolete("Use TransientErrorHandler instead")]
[ExcludeFromCodeCoverage]
public bool UsePolly { get; set; }
Property Value
UseWindowsAuthentication
Set this to true to use the current Windows user's credentials for HTTP authentication.
public bool UseWindowsAuthentication { get; set; }