XBullet.EasyTesting.Snapshots.Http 1.0.16

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

XBullet.EasyTesting.Snapshots.Http

Snapshot adapters for requests and complete exchanges captured by XBullet.EasyTesting.Http, plus hosted scenario integration for HttpExchangeRecorder. The package references XBullet.EasyTesting.Snapshots.Core and keeps the existing XBullet.EasyTesting.Snapshots namespace.

The package targets .NET 8, .NET 9, and .NET 10.

Install

dotnet add package XBullet.EasyTesting.Snapshots.Http

Example

using var response = await client.PostAsJsonAsync("/orders", order);

await handler.ShouldMatchExchangesSnapshot();

For a hosted fluent scenario, SnapshotScenario() attaches an HttpExchangeRecorder before the request is sent:

using var result = await scope.SnapshotScenario(options =>
        options.Request.RedactingHeader("X-Request-Secret"))
    .PostJson("/api/products", request)
    .ExecuteAsync(cancellationToken);

await result.Response.ShouldMatchHttpExchangeSnapshot(
    configureSnapshot: settings => settings.ScrubMember("id"),
    cancellationToken: cancellationToken);

Outbound request and exchange assertions likewise accept configureRequest, configureExchange, and configureSnapshot callbacks in addition to prebuilt option and settings instances.

Exchange snapshots contain each request and its response status, stable headers, and normalized body. Send failures and response-body read failures are captured as stable exception type/message pairs. JSON request and response bodies are captured structurally; text remains text and binary content is stored as base64. Response content that has not been consumed is represented as {NotRead} rather than being read eagerly by the recorder.

Configure capture

Request and response capture can be customized independently:

var options = new StubHttpExchangeSnapshotOptions();
options.Request
    .IgnoringHeaders("X-Retry-Count")
    .RedactingHeader("X-Session")
    .RedactingQueryParameter("tenant_secret")
    .ScrubbingUrlPathGuids()
    .ScrubbingQueryParameters("timestamp", "requestId");
options.Response
    .IgnoringHeaders("ETag")
    .RedactingHeader("Set-Cookie");

await handler.ShouldMatchExchangesSnapshot(
    options,
    new SnapshotSettings().ScrubMembers("timestamp", "requestId"));

JSON is the default. Complete exchanges can instead use an HTTP-style .verified.txt transcript or deterministic .verified.yaml output:

var options = new StubHttpExchangeSnapshotOptions
{
    Format = HttpExchangeSnapshotFormat.Yaml // or Http
};

await handler.ShouldMatchExchangesSnapshot(options);

Structured JSON scrubbers are applied before either alternative format is rendered.

Request-only snapshots remain available:

await handler.ShouldMatchRequestsSnapshot(
    new StubHttpRequestSnapshotOptions()
        .IgnoringHeaders("X-Retry-Count")
        .RedactingHeader("X-Session")
        .RedactingQueryParameter("tenant_secret")
        .ScrubbingUrlPathGuids()
        .ScrubbingQueryParameters("timestamp", "requestId"),
    new SnapshotSettings()
        .ScrubMembers("timestamp", "requestId"));

JSON request bodies are captured structurally with System.Text.Json. Authorization, cookies, API keys, correlation IDs, and tracing headers are excluded by default. Common secret-bearing query parameters are redacted by default; additional header and query values can be preserved as {Redacted}.

Complete GUID path segments are captured as {Guid} when ScrubbingUrlPathGuids() is enabled. Use ScrubbingUrlPath(path => ...) for other route transformations. Scrubbed query values appear as {Scrubbed}; security-redacted query values appear as {Redacted} and take precedence.

Documentation

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 (1)

Showing the top 1 NuGet packages that depend on XBullet.EasyTesting.Snapshots.Http:

Package Downloads
XBullet.EasyTesting.Snapshots

Compatibility facade for the split snapshot core and outbound HTTP adapter packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.16 0 9/30/2026
1.0.15 35 9/29/2026
1.0.14 79 9/27/2026
1.0.13 85 9/26/2026
1.0.12 87 9/25/2026
1.0.11 87 9/24/2026
1.0.9 83 9/24/2026
1.0.8 111 9/21/2026
1.0.7 106 9/19/2026
1.0.6 109 9/18/2026
1.0.5 100 9/18/2026