Unfucked.HTTP 0.0.1-beta.24

This is a prerelease version of Unfucked.HTTP.
dotnet add package Unfucked.HTTP --version 0.0.1-beta.24
                    
NuGet\Install-Package Unfucked.HTTP -Version 0.0.1-beta.24
                    
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="Unfucked.HTTP" Version="0.0.1-beta.24" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Unfucked.HTTP" Version="0.0.1-beta.24" />
                    
Directory.Packages.props
<PackageReference Include="Unfucked.HTTP" />
                    
Project file
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 Unfucked.HTTP --version 0.0.1-beta.24
                    
#r "nuget: Unfucked.HTTP, 0.0.1-beta.24"
                    
#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 Unfucked.HTTP@0.0.1-beta.24
                    
#: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=Unfucked.HTTP&version=0.0.1-beta.24&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Unfucked.HTTP&version=0.0.1-beta.24&prerelease
                    
Install as a Cake Tool

🧰 Unfucked.HTTP

NuGet GitHub Actions Testspace Coveralls

Fix egregiously missing or broken functionality in HttpClient. Inspired by JAX-RS and Jersey Client.

Unfuck your house

Installation

dotnet add package Unfucked.HTTP
using Unfucked;
using Unfucked.HTTP;

Configuration

  • Drop-in subclasses of HttpClient and HttpMessageHandler, and extension methods
    HttpClient http = new UnfuckedHttpClient(); // set the subclass
    http = new UnfuckedHttpClient(new SocketsHttpHandler(){ AllowAutoRedirect = false }); // custom handlers are wrapped automatically
    

Usage

  • Immutable builder pattern for HTTP request URLs, headers, verbs, and response representations that is fluent, composable, and avoids accidentally reusing stale state and sending to corrupted URLs
    JsonNode responseBody = await http.Target("https://httpbin.org")
        .Path("get")
        .Accept(MediaTypeNames.Application.Json)
        .Get<JsonNode>();
    
  • Request and response filtering
    PrintRequests filter = new PrintRequests();
    http.Register((ClientRequestFilter) filter);
    http.Register((ClientResponseFilter) filter);
    
    class PrintRequests: ClientRequestFilter, ClientResponseFilter {
        public async ValueTask<HttpRequestMessage> Filter(HttpRequestMessage request, CancellationToken cancellationToken) {
            Console.WriteLine(">> {0} {1}", request.Method, request.RequestUri);
            return request;
        }
    
        public async ValueTask<HttpResponseMessage> Filter(HttpResponseMessage response, CancellationToken cancellationToken) {
            Console.WriteLine("<< {0} {1}", (int) response.StatusCode, response.RequestMessage?.RequestUri);
            return response;
        }
    }
    
  • Wire logging (requires .NET ≥ 8 and HTTP 1.1)
    NLog.Logger wireLogger = NLog.LogManager.GetLogger("wire"); // you can plug in any logging implementation, such as NLog or Microsoft.Extensions.Logging
    HttpClient http = new UnfuckedHttpClient();
    http.Register(new WireLoggingFilter(new WireLoggingFilter.Config {
        LogRequestTransmitted = (message, id) => wireLogger.Trace("{0} >> {1}", id, message),
        LogResponseReceived   = (message, id) => wireLogger.Trace("{0} << {1}", id, message),
        IsLogEnabled          = () => wireLogger.IsTraceEnabled
    }));
    
  • Type-safe property registration
    // set on shared client or ClientConfig
    http.Property(PropertyKey.JsonSerializerOptions, new JsonSerializerOptions()); 
    
    // set on immutable request target
    WebTarget target = http.Target("https://httpbin.org")
        .Property(PropertyKey.ThrowOnUnsuccessfulStatusCode, false); 
    
  • Automatic response deserialization to given types from XML, JSON, and pluggable custom representations
    // automatically mapped from JSON or XML depending on response content type, falling back to content sniffing
    MyClass response = await http.Target(url).Get<MyClass>();
    
  • Rich exception class hierarchy
    try {
        string response = await http.Target(url).Get<string>();
    } catch(NotFoundException) {       // 404
    } catch(NotAuthorizedException) {  // 401
    } catch(ServerErrorException) {    // 5xx
    } catch(WebApplicationException) { // any unsuccessful status code
    } catch(ProcessingException) { }   // network or deserialization error, like DNS, connection refused, timeout
    
  • Mockable and verifiable in unit or layer tests

All Unfucked libraries

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Unfucked.HTTP:

Package Downloads
Gandi

Gandi LiveDNS API client that can create, read, update, and delete DNS records

InoreaderCs

.NET client for the Inoreader HTTP API

qBittorrentApiClient

Client for qBittorrent HTTP API

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.0.1-beta.24 90 2/28/2026
0.0.1-beta.23 85 2/19/2026
0.0.1-beta.22 268 11/23/2025
0.0.1-beta.21 320 11/11/2025
0.0.1-beta.20 196 11/6/2025
0.0.1-beta.19 165 11/2/2025
0.0.1-beta.18 182 10/28/2025
0.0.1-beta.17 171 10/27/2025
0.0.1-beta.16 171 10/22/2025
0.0.1-beta.15 166 10/21/2025
0.0.1-beta.14 180 10/19/2025
0.0.1-beta.13 305 9/25/2025
0.0.1-beta.12 141 9/12/2025
0.0.1-beta.11 249 7/14/2025
0.0.1-beta.10 164 7/14/2025
0.0.1-beta.9 110 7/12/2025
0.0.1-beta.8 90 7/12/2025
0.0.1-beta.7 199 7/3/2025
0.0.1-beta.6 178 6/29/2025
0.0.1-beta.5 173 6/29/2025
Loading failed