Nestgrid.Response.Http.Client 0.8.0

dotnet add package Nestgrid.Response.Http.Client --version 0.8.0
                    
NuGet\Install-Package Nestgrid.Response.Http.Client -Version 0.8.0
                    
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="Nestgrid.Response.Http.Client" Version="0.8.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Nestgrid.Response.Http.Client" Version="0.8.0" />
                    
Directory.Packages.props
<PackageReference Include="Nestgrid.Response.Http.Client" />
                    
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 Nestgrid.Response.Http.Client --version 0.8.0
                    
#r "nuget: Nestgrid.Response.Http.Client, 0.8.0"
                    
#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 Nestgrid.Response.Http.Client@0.8.0
                    
#: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=Nestgrid.Response.Http.Client&version=0.8.0
                    
Install as a Cake Addin
#tool nuget:?package=Nestgrid.Response.Http.Client&version=0.8.0
                    
Install as a Cake Tool

Nestgrid.Response.Http.Client

Nestgrid.Response.Http.Client interprets an HTTP response as a Nestgrid Result or Result<T>. It is the client-side counterpart to the server adapters, but it does not reverse server-side result mappings.

Installation

dotnet add package Nestgrid.Response.Http.Client

Quick start

Use the reader when the response is already available:

using Nestgrid.Response.Http.Client;

var reader = new NestgridResponseReader(
    new NestgridResponseClientOptions(NestgridResponsePayloadMode.ValueOnly));

using HttpResponseMessage response = await httpClient.GetAsync("/licences/17");
Result<Licence> result = await reader.ReadAsync<Licence>(response);

Use the thin convenience method when the package should send and interpret a request. The response created by HttpClient is disposed by the convenience method; the caller-created request and HttpClient remain caller-owned:

using var request = new HttpRequestMessage(HttpMethod.Get, "/licences/17");
Result<Licence> result = await httpClient.SendAndReadNestgridResponseAsync<Licence>(
    request,
    reader,
    cancellationToken);

Authentication, other handlers, retries, resilience, logging, telemetry and IHttpClientFactory registration remain normal consumer-owned HttpClient composition.

Payload modes

The mode is explicit and is never inferred from JSON shape.

Mode Generic success Non-generic success Failure
FullResult Envelope containing Value and Messages Envelope containing Messages Envelope containing Messages
ValueOnly Body is the declared T value Envelope containing Messages, or an empty 200/201/202 body Envelope containing Messages

204 No Content always returns the existing typed or non-generic NoContent result. A generic operation with an empty 200, 201 or 202 body is a protocol failure because its declared value is missing.

HTTP outcome mappings

The client interprets the observed HTTP status. It does not reconstruct the server-side ResultStatus that may have produced it.

HTTP status Client result status
200 Ok
201 Created
202 Accepted
204 NoContent
400 Invalid
401 Unauthorized
403 Forbidden
404 NotFound
409 Conflict
422 Failed
500–599 Error

Mappings can be extended or replaced through the immutable client policy. Three-hundred-series and otherwise unmapped statuses are protocol failures by default.

JSON and media types

The package supports JSON only through the centrally managed System.Text.Json baseline. application/json and +json media types are accepted. A missing media type is accepted for compatibility with legacy HTTP responses. Plain text, XML and other non-JSON media types are rejected with NestgridResponseProtocolException.

The client options snapshot the supported serializer settings at construction, including naming, casing, comments, trailing commas, null handling, encoder, depth, indentation and custom converters. A reader takes another snapshot when it is constructed, so later mutation of the caller's options cannot change that reader's behaviour. Other JsonSerializerOptions properties are outside the currently supported client contract and are not claimed to be preserved; the supported subset is subject to the pre-1.0 contract decision recorded as IR-018.

Response content is limited to 1 MiB by default through MaxResponseBodyBytes. Configure a larger positive limit explicitly only when the endpoint and payload size are trusted and understood. The limit is enforced while streaming for successful and failed responses; an over-limit response raises a protocol exception.

Messages and failures

Wire messages preserve message text, code, property and severity through the existing ResultMessages factories. Malformed JSON, invalid envelopes, wrong payload representations, invalid messages and unsupported statuses raise NestgridResponseProtocolException without exposing raw response bodies or sensitive headers.

Protocol exceptions are package-generated safe boundary failures. Their public construction surface is intentionally restricted; serializer and custom-converter failures are normalised to fixed messages with no inner exception. API-provided failure messages remain in returned results.

Network, DNS, TLS, timeout and cancellation failures remain standard HttpClient exceptions. They are not converted into application results.

Scope

This package does not provide authentication, endpoint-specific clients, generic HTTP abstractions, global handlers, retries, resilience, DI registration, logging or telemetry. Consumers own those concerns and the lifetime of HttpClient.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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 was computed.  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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.8.0 43 8/28/2026