Soenneker.Dtos.HttpClientOptions
4.0.30
Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Soenneker.Dtos.HttpClientOptions --version 4.0.30
NuGet\Install-Package Soenneker.Dtos.HttpClientOptions -Version 4.0.30
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Soenneker.Dtos.HttpClientOptions" Version="4.0.30" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Dtos.HttpClientOptions" Version="4.0.30" />
<PackageReference Include="Soenneker.Dtos.HttpClientOptions" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Soenneker.Dtos.HttpClientOptions --version 4.0.30
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Soenneker.Dtos.HttpClientOptions, 4.0.30"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Soenneker.Dtos.HttpClientOptions@4.0.30
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Soenneker.Dtos.HttpClientOptions&version=4.0.30
#tool nuget:?package=Soenneker.Dtos.HttpClientOptions&version=4.0.30
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Soenneker.Dtos.HttpClientOptions
A DTO type for common HttpClient options functionality.
Install
dotnet add package Soenneker.Dtos.HttpClientOptions
What you get
HttpClientOptions— A DTO type for common HttpClient options functionality.
API at a glance
| API | What it does | Result / important behavior |
|---|---|---|
HttpClientOptions.PooledConnectionLifetime |
Gets or sets the maximum lifetime of a connection in the connection pool before it is discarded. A value of null indicates that the connection will not have a limited lifetime. Default when null: 600 seconds (10 minutes). Framework default: infinite (no limit). |
Gets or sets the maximum lifetime of a connection in the connection pool before it is discarded. A value of null indicates that the connection will not have a limited lifetime. Default when null: 600 seconds (10 minutes). Framework default: infinite (no limit). |
HttpClientOptions.UseCookieContainer |
Gets or sets a value indicating whether the HttpClient should use a cookie container to store and manage cookies. A value of null indicates that the default behavior of the client will be used. Default when null: false. Framework default: false. |
Gets or sets a value indicating whether the HttpClient should use a cookie container to store and manage cookies. A value of null indicates that the default behavior of the client will be used. Default when null: false. Framework default: false. |
HttpClientOptions.MaxConnectionsPerServer |
Gets or sets the maximum number of concurrent connections allowed per server. A value of null indicates that the default value will be used. Default when null: 40. Framework default: int.MaxValue. |
Gets or sets the maximum number of concurrent connections allowed per server. A value of null indicates that the default value will be used. Default when null: 40. Framework default: int.MaxValue. |
HttpClientOptions.Timeout |
Gets or sets the time to wait before the request times out. This is the overall HttpClient.Timeout (request timeout), not the connect timeout. Default when null: 100 seconds. Framework default: 100 seconds. |
Gets or sets the time to wait before the request times out. This is the overall HttpClient.Timeout (request timeout), not the connect timeout. Default when null: 100 seconds. Framework default: 100 seconds. |
HttpClientOptions.ConnectTimeout |
Gets or sets the time to wait when establishing a TCP connection. This maps to SocketsHttpHandler.ConnectTimeout. A value of null indicates that the framework default will be used (typically Infinite). |
Gets or sets the time to wait when establishing a TCP connection. This maps to SocketsHttpHandler.ConnectTimeout. A value of null indicates that the framework default will be used (typically Infinite). |
HttpClientOptions.DefaultRequestHeaders |
Gets or sets a collection of default headers to be included with each request. A value of null indicates that no default headers will be added. |
Gets or sets a collection of default headers to be included with each request. A value of null indicates that no default headers will be added. |
HttpClientOptions.ModifyClient |
Gets or sets a function to modify the HttpClient after it has been created. This function is only executed during the first retrieval of the client. |
Gets or sets a function to modify the HttpClient after it has been created. This function is only executed during the first retrieval of the client. |
HttpClientOptions.BaseAddress |
Gets or sets the base address of the HttpClient as a Uri. |
Gets or sets the base address of the HttpClient as a Uri. |
HttpClientOptions.ModifyPrimaryHandler |
Gets or sets an action that customizes a cache-created and cache-owned SocketsHttpHandler. Setting this creates a dedicated transport for the cached client rather than using a shared transport. The action runs after all other handler-specific options have been applied. |
Gets or sets an action that customizes a cache-created and cache-owned SocketsHttpHandler. Setting this creates a dedicated transport for the cached client rather than using a shared transport. The action runs after all other handler-specific options have been applied. |
HttpClientOptions.DelegatingHandlerFactories |
Gets or sets factories for handlers that decorate the cache-owned transport handler. Factories are invoked once when the cached client is created. The first factory produces the outermost handler. The returned handlers must not have DelegatingHandler.InnerHandler set and are owned by the cache. |
Gets or sets factories for handlers that decorate the cache-owned transport handler. Factories are invoked once when the cached client is created. The first factory produces the outermost handler. The returned handlers must not have DelegatingHandler.InnerHandler set and are owned by the cache. |
HttpClientOptions.ResponseDrainTimeout |
Gets or sets the timeout when draining response content. A value of null indicates that the default timeout will be used. Default when null: 2 seconds. Framework default: 2 seconds. |
Gets or sets the timeout when draining response content. A value of null indicates that the default timeout will be used. Default when null: 2 seconds. Framework default: 2 seconds. |
HttpClientOptions.AllowAutoRedirect |
Gets or sets a value indicating whether the handler should automatically follow redirect responses. A value of null indicates that the default behavior will be used. Default when null: true. Framework default: true. |
Gets or sets a value indicating whether the handler should automatically follow redirect responses. A value of null indicates that the default behavior will be used. Default when null: true. Framework default: true. |
HttpClientOptions.AutomaticDecompression |
Gets or sets the automatic decompression method for response content. A value of null indicates that the default behavior will be used. Default when null: DecompressionMethods.None. Framework default: DecompressionMethods.None. |
Gets or sets the automatic decompression method for response content. A value of null indicates that the default behavior will be used. Default when null: DecompressionMethods.None. Framework default: DecompressionMethods.None. |
HttpClientOptions.KeepAlivePingDelay |
Gets or sets the delay between keep-alive pings. A value of null indicates that the default delay will be used. Default when null: Infinite (no keep-alive pings). Framework default: Infinite. |
Gets or sets the delay between keep-alive pings. A value of null indicates that the default delay will be used. Default when null: Infinite (no keep-alive pings). Framework default: Infinite. |
HttpClientOptions.KeepAlivePingTimeout |
Gets or sets the timeout for keep-alive pings. A value of null indicates that the default timeout will be used. Default when null: 20 seconds. Framework default: 20 seconds. |
Gets or sets the timeout for keep-alive pings. A value of null indicates that the default timeout will be used. Default when null: 20 seconds. Framework default: 20 seconds. |
HttpClientOptions.KeepAlivePingPolicy |
Gets or sets the keep-alive ping policy. A value of null indicates that the default policy will be used. Default when null: HttpKeepAlivePingPolicy.Always. Framework default: HttpKeepAlivePingPolicy.Always. |
Gets or sets the keep-alive ping policy. A value of null indicates that the default policy will be used. Default when null: HttpKeepAlivePingPolicy.Always. Framework default: HttpKeepAlivePingPolicy.Always. |
HttpClientOptions.UseProxy |
Gets or sets a value indicating whether the handler should use a proxy. A value of null indicates that the default behavior will be used. Default when null: true. Framework default: true. |
Gets or sets a value indicating whether the handler should use a proxy. A value of null indicates that the default behavior will be used. Default when null: true. Framework default: true. |
HttpClientOptions.Proxy |
Gets or sets the proxy to use for requests. A value of null indicates that the default proxy will be used. Default when null: System proxy (from HttpClient.DefaultProxy). Framework default: System proxy. |
Gets or sets the proxy to use for requests. A value of null indicates that the default proxy will be used. Default when null: System proxy (from HttpClient.DefaultProxy). Framework default: System proxy. |
Practical notes
- Calls that return a cached or singleton value reuse the same instance until the owning service is disposed.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Soenneker.Dtos.HttpClientOptions:
| Package | Downloads |
|---|---|
|
Soenneker.Utils.HttpClientCache
Providing thread-safe singleton HttpClients |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.32 | 5,513 | 9/12/2026 |
| 4.0.31 | 177,891 | 8/30/2026 |
| 4.0.30 | 132 | 8/29/2026 |
| 4.0.29 | 134,873 | 8/13/2026 |
| 4.0.28 | 97 | 8/13/2026 |
| 4.0.27 | 103,387 | 7/27/2026 |
| 4.0.26 | 111,029 | 7/16/2026 |
| 4.0.25 | 122,150 | 6/18/2026 |
| 4.0.24 | 114,938 | 6/5/2026 |
| 4.0.23 | 169,023 | 4/22/2026 |
| 4.0.22 | 130,972 | 3/12/2026 |
| 4.0.21 | 136 | 3/12/2026 |
| 4.0.20 | 126 | 3/12/2026 |
| 4.0.19 | 5,247 | 3/12/2026 |
| 4.0.18 | 24,753 | 3/10/2026 |
| 4.0.17 | 18,967 | 3/9/2026 |
| 4.0.16 | 128 | 3/9/2026 |
| 4.0.15 | 3,734 | 3/9/2026 |
| 4.0.14 | 35,264 | 3/4/2026 |
| 4.0.13 | 212,544 | 1/5/2026 |
Loading failed
Improve README usability and API guidance