Soenneker.Extensions.HttpResponseMessage 4.0.2441

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Soenneker.Extensions.HttpResponseMessage --version 4.0.2441
                    
NuGet\Install-Package Soenneker.Extensions.HttpResponseMessage -Version 4.0.2441
                    
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.Extensions.HttpResponseMessage" Version="4.0.2441" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Extensions.HttpResponseMessage" Version="4.0.2441" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Extensions.HttpResponseMessage" />
                    
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 Soenneker.Extensions.HttpResponseMessage --version 4.0.2441
                    
#r "nuget: Soenneker.Extensions.HttpResponseMessage, 4.0.2441"
                    
#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.Extensions.HttpResponseMessage@4.0.2441
                    
#: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.Extensions.HttpResponseMessage&version=4.0.2441
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Extensions.HttpResponseMessage&version=4.0.2441
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

alternate text is missing from this package README image Soenneker.Extensions.HttpResponseMessage

A collection of helpful HttpResponseMessage extension methods.

Installation

dotnet add package Soenneker.Extensions.HttpResponseMessage

Quick start

using Soenneker.Extensions.HttpResponseMessage;

// Given an existing System.Net.Http.HttpResponseMessage named message:
var result = message.EnsureSuccess();

Common operations

  • EnsureSuccess() - Reads the content (only if needed for logging), logs it, then calls EnsureSuccessStatusCode. Useful in tests.
  • To() - Exception-safe JSON to T from the response body (returns default on failure).
  • ToFromXml() - XML deserialize to T (exception-safe, default on failure).
  • ToResult() - OperationResult wrapper using single buffered read.
  • ToStrict() - Strict JSON to T (throws on failure).
  • ToStringSafe() - Exception-safe content->string (returns null on failure).
  • ToStringStrict() - Raw content as string (throws on failure).
  • LogResponse() - Log response body at Debug (single read & capped).
  • IsNoContent() - Returns true when the HTTP status code is 204 No Content.
  • IsJson() - Returns true when the response content type is JSON, including structured +json media types.
  • IsProblemJson() - Returns true when the response uses the application/problem+json problem-details media type.
  • IsXml() - Returns true when the response content type is XML, including structured +xml media types.

The package also includes one additional operation for more specialized cases.

Product 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.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Soenneker.Extensions.HttpResponseMessage:

Package Downloads
Soenneker.Extensions.HttpClient

A collection of helpful HttpClient extension methods, like retry and auto (de)serialization

Soenneker.Blazor.Consumers.Base

A wrapper around Soenneker.Blazor.ApiClient supporting auto (de)serialization for requests/responses/ProblemDetails.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.2460 0 8/31/2026
4.0.2459 0 8/31/2026
4.0.2458 0 8/31/2026
4.0.2456 0 8/30/2026
4.0.2453 0 8/30/2026
4.0.2451 0 8/30/2026
4.0.2450 0 8/30/2026
4.0.2449 9 8/30/2026
4.0.2447 31 8/30/2026
4.0.2445 35 8/30/2026
4.0.2444 64 8/30/2026
4.0.2442 58 8/30/2026
4.0.2441 167 8/30/2026
4.0.2438 212 8/29/2026
4.0.2437 39 8/29/2026
4.0.2436 35 8/29/2026
4.0.2435 40 8/29/2026
4.0.2434 717 8/26/2026
4.0.2433 224 8/26/2026
4.0.2432 283 8/26/2026
Loading failed

Update dependency Soenneker.Utils.Xml to 4.0.1119 (#2949)