KeelMatrix.HookReplay
0.1.1
Prefix Reserved
dotnet add package KeelMatrix.HookReplay --version 0.1.1
NuGet\Install-Package KeelMatrix.HookReplay -Version 0.1.1
<PackageReference Include="KeelMatrix.HookReplay" Version="0.1.1" />
<PackageVersion Include="KeelMatrix.HookReplay" Version="0.1.1" />
<PackageReference Include="KeelMatrix.HookReplay" />
paket add KeelMatrix.HookReplay --version 0.1.1
#r "nuget: KeelMatrix.HookReplay, 0.1.1"
#:package KeelMatrix.HookReplay@0.1.1
#addin nuget:?package=KeelMatrix.HookReplay&version=0.1.1
#tool nuget:?package=KeelMatrix.HookReplay&version=0.1.1
KeelMatrix.HookReplay
Record an intentional HttpClient exchange once, then replay it deterministically in tests and CI without any network fallback. HookReplay stores sanitized, versioned cassettes that are safe to review and commit.
Install
dotnet add package KeelMatrix.HookReplay --version 0.1.1
Quick Start
Record one interaction while the test server is available:
using KeelMatrix.HookReplay;
var recordOptions = new HookReplayOptions("cassettes/greeting.json")
{
Mode = HookReplayMode.Record
};
using (var recorder = HookReplayClient.Create(recordOptions))
using (HttpResponseMessage recorded = await recorder.GetAsync("https://api.example.test/greeting"))
{
Console.WriteLine(await recorded.Content.ReadAsStringAsync());
}
Stop the server or otherwise remove network access, then replay the same request offline:
var replayOptions = new HookReplayOptions("cassettes/greeting.json")
{
Mode = HookReplayMode.Replay
};
using var replay = HookReplayClient.Create(replayOptions);
using HttpResponseMessage response =
await replay.GetAsync("https://api.example.test/greeting");
Replay never falls back to the network. A cassette miss throws HookReplayMismatchException, even when an inner handler is configured.
Important Limitations
- Supported target frameworks are
net8.0andnetstandard2.0. - Empty, text, JSON, and
application/x-www-form-urlencodedbodies are supported. Streaming, multipart, and arbitrary binary content are not. - Request and response bodies are bounded to 1 MiB by default. Set
HookReplayOptions.MaxBodyBytesto a lower or higher bounded value when appropriate. A complete cassette is limited to 32 MiB. - Repeated identical requests consume matching recorded interactions sequentially. Concurrent indistinguishable requests are not deterministically orderable; use a selected matching header or custom matcher when they must be distinguished.
Documentation
The repository README covers the broader product workflow. See the cassette compatibility policy, security policy, privacy policy, and contributing guide for canonical details.
License
MIT © KeelMatrix
| Product | Versions 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 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. |
-
.NETStandard 2.0
- KeelMatrix.Redaction (= 0.1.0)
- KeelMatrix.Telemetry (= 0.1.1)
- System.Text.Json (>= 10.0.12)
-
net8.0
- KeelMatrix.Redaction (= 0.1.0)
- KeelMatrix.Telemetry (= 0.1.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.