package to help manage of httpHelper
$ dotnet add package CSharpEssentials.HttpHelper
A significant improvement has been introduced to allow users to inject a custom SocketsHttpHandler when configuring a named HttpClient. This enhancement provides granular control over network behavior, such as connection settings, proxy configuration, and automatic HTTP compression.
Example: Enabling Automatic HTTP Compression
You can now configure automatic HTTP decompression for your named client:
var handler = new SocketsHttpHandler
{
// Enable automatic decompression for GZip and Deflate
AutomaticDecompression = System.Net.DecompressionMethods.GZip | System.Net.DecompressionMethods.Deflate,
};
builder.Services.AddHttpClients(builder.Configuration, handler);CSharpEssentials.HttpHelper is a lightweight helper to simplify the usage of HttpClient in .NET with a fluent, configurable API.
It provides convenient methods for request customization, retries, timeouts, authentication headers, and more.
The full documentation and usage examples (GET requests, retries, authentication, and more) are available here:
Contributions, issues, and feature requests are welcome! Feel free to open a pull request or issue.
Distributed under the MIT License. See LICENSE for more information.
---