ProtoTest.Http 1.0.1

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

ProtoTest.Http

Shared HTTP client plumbing and the [Auth<T>] model behind REST, GraphQL and gRPC — an extension point for protocol authors, normally transitive.

dotnet add package ProtoTest.Http

Application tests reference ProtoTest.Rest or ProtoTest.GraphQL, which bring this package in; build directly on it only when writing an HTTP-based protocol integration.

Quick start

// A protocol package registers its keyed options once, under its own section.
ProtoHttpOptionsRegistration.ConfigureResponseOptions(
    services,
    protocolName: "Widgets",
    configurationSectionName: "ProtoTest:Widgets:Responses",
    options => options.MaxResponseBodyBytes = 5 * 1024 * 1024);

// The running test resolves them through the shared execution context.
var options = context.ResolveResponseOptions("Widgets");

// Named clients are created through IHttpClientFactory and traced as client entities.
services.AddSingleton<IProtoClientInitializer<HttpClient>>(
    new ProtoHttpClientInitializer("Widgets", "Default", explicitBaseUrl: "https://widgets.example.test"));

var resolution = ProtoHttpClientResolver.Resolve(context, "Widgets");

What it adds

  • Client initializationProtoHttpClientInitializer resolves an address from the explicit argument, ProtoTest:Applications:{application}:BaseUrl (joined with Endpoints:{name}), or the application's in-process transport.
  • Response optionsProtoHttpResponseOptions (MaxResponseBodyBytes 10 MiB, MaxDiagnosticBodyLength 64 KiB); register with TryAddResponseOptions/ConfigureResponseOptions and read with ResolveResponseOptions.
  • Attachment optionsProtoHttpAttachmentOptions (capture flags, redaction and sensitive header/query/JSON lists); read with ResolveAttachmentOptions, which returns null when the protocol never opted in.
  • BufferingProtoHttpResponseBuffer.BufferAsync enforces the limit and throws ProtoResponseTooLargeException; the content is replaced with a readable buffered copy.
  • AuthenticationIProtoHttpAuthenticator, [Auth<T>], BearerTokenAuthenticator, BasicAuthAuthenticator, ApiKeyAuthenticator and ProtoCompositeHttpAuthenticator.
  • DiagnosticsProtoHttpDiagnosticSanitizer redacts JSON/form/multipart/XML bodies, headers and URIs; header values are never traced.

Responses are buffered in full in memory and the package has no retry policy; TryAddResponseOptions is first-wins.

Learn more

Product Compatible and additional computed target framework versions.
.NET 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 is compatible.  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 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 (4)

Showing the top 4 NuGet packages that depend on ProtoTest.Http:

Package Downloads
ProtoTest.Rest

Runner-independent REST integration testing for ProtoTest.

ProtoTest.Grpc

gRPC integration for ProtoTest: named channels, metadata authentication, unary and streaming helpers, tracing and coverage.

ProtoTest.GraphQL

Fluent, runner-independent GraphQL integration testing for ProtoTest.

ProtoTest.OpenApi

OpenAPI contract coverage for ProtoTest REST tests.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 107 9/20/2026
1.0.0 108 9/20/2026