CoreSystem.Http
1.2.0
dotnet add package CoreSystem.Http --version 1.2.0
NuGet\Install-Package CoreSystem.Http -Version 1.2.0
<PackageReference Include="CoreSystem.Http" Version="1.2.0" />
<PackageVersion Include="CoreSystem.Http" Version="1.2.0" />
<PackageReference Include="CoreSystem.Http" />
paket add CoreSystem.Http --version 1.2.0
#r "nuget: CoreSystem.Http, 1.2.0"
#:package CoreSystem.Http@1.2.0
#addin nuget:?package=CoreSystem.Http&version=1.2.0
#tool nuget:?package=CoreSystem.Http&version=1.2.0
🌐 CoreSystem.Http
Build HTTP features once. Reuse them everywhere.
Production-ready HTTP infrastructure for ASP.NET Core, .NET 8, .NET 9 and .NET 10.
CoreSystem.Http provides reusable infrastructure for capturing and replaying HTTP responses in ASP.NET Core applications. It offers lightweight, dependency-free components that simplify response interception while promoting code reuse across middleware, pipelines, and application frameworks.
Designed as a foundational building block, CoreSystem.Http can be used by caching, idempotency, auditing, logging, security, or any feature that requires capturing or reproducing HTTP responses.
Why use CoreSystem.Http?
ASP.NET Core provides powerful HTTP primitives, but reusable response capture and replay often require repetitive boilerplate code.
CoreSystem.Http extracts these capabilities into reusable building blocks that can be shared across multiple libraries and applications.
✨ Features
- ✅ Capture responses from the ASP.NET Core pipeline
- ✅ Replay captured responses
- ✅ Response body buffering
- ✅ Header preservation
- ✅ HEAD request support
- ✅ Lightweight and dependency-free
- ✅ Built for ASP.NET Core
- ✅ Reusable across middleware, libraries and application frameworks
📦 Installation
dotnet add package CoreSystem.Http
🚀 Quick Start
Register CoreSystem.Http:
builder.Services.AddCoreHttp();
Inject the required services:
public sealed class MyHandler(
IResponseCapture responseCapture,
IHttpResponseWriter responseWriter)
{
}
Capture an HTTP response:
CapturedResponse response =
await responseCapture.CaptureAsync(
context,
next,
cancellationToken);
Replay the captured response:
await responseWriter.WriteAsync(
context,
response,
cancellationToken);
📖 Public API
CoreSystem.Http intentionally exposes a small, focused and stable public API.
| Type | Kind | Description |
|---|---|---|
IResponseCapture |
Interface | Captures the HTTP response produced by the ASP.NET Core request pipeline. |
IHttpResponseWriter |
Interface | Replays a previously captured response to the current HttpContext. |
CapturedResponse |
Model | Represents a captured HTTP response, including the status code, headers, content type, and response body. |
AddCoreHttp() |
Extension Method | Registers all CoreSystem.Http services required for response capture and replay. |
🏗 Architecture
CoreSystem.Http separates response capture from response replay, allowing both components to be reused independently.
HTTP Request
│
▼
ASP.NET Core Pipeline
│
▼
IResponseCapture
│
▼
CapturedResponse
│
├───────────────┐
│ │
▼ ▼
CoreSystem.Cache CoreSystem.Idempotency
│ │
└───────────────┘
│
▼
IHttpResponseWriter
│
▼
HTTP Response
🎯 Use Cases
CoreSystem.Http serves as reusable infrastructure for features such as:
- HTTP response caching
- Idempotency
- Audit logging
- Response transformation
- API gateways
- Reverse proxies
- Middleware development
- Custom ASP.NET Core frameworks
Dependencies
CoreSystem.Http has no external runtime dependencies beyond ASP.NET Core.
📚 Documentation
The full documentation includes:
- Getting Started
- Architecture
- Dependency Injection
- Response Capture
- Response Replay
- Extensibility
- Best Practices
📚 Documentation
Documentation is continuously expanding as CoreSystem evolves.
Additional guides, architecture notes and examples will be available in the project's documentation site.
🤝 Contributing
Issues, discussions and pull requests are welcome.
📄 License
Released under the MIT License.
| Product | Versions 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. |
-
net10.0
- No dependencies.
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages (6)
Showing the top 5 NuGet packages that depend on CoreSystem.Http:
| Package | Downloads |
|---|---|
|
CoreSystem.Cache
Production-ready cache abstraction for .NET 8, .NET 9 and .NET 10 with In-Memory caching, extensible external storage, tag-based invalidation, HTTP response caching, and OpenTelemetry metrics. |
|
|
CoreSystem.Idempotency
Production-ready idempotency framework for ASP.NET Core featuring duplicate suppression, request fingerprinting, response replay, OpenTelemetry integration, and a provider-based storage architecture. |
|
|
CoreSystem.Cache.Rehydration
Cache recovery component for CoreSystem.Cache on .NET 8, .NET 9 and .NET 10 that restores tracked memory fallback entries to the primary cache provider after recovery. |
|
|
CoreSystem.Cache.Redis
Redis external cache provider for CoreSystem.Cache on .NET 8, .NET 9 and .NET 10, with tag-based invalidation, distributed locking, health checks, and optional resilience integration. |
|
|
CoreSystem.Idempotency.PostgreSql
Production-ready PostgreSQL storage provider for CoreSystem.Idempotency, providing durable persistence through the IIdempotencyStorage abstraction with Dapper-based data access. Ships an idempotent schema script at scripts/postgres.sql. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Initial stable release.
• HTTP response capture
• HTTP response replay
• Header preservation
• ASP.NET Core integration
• Dependency Injection support
• Production-ready implementation
1.2.0: Targets net8.0, net9.0 and net10.0 (previously net8.0 only). No public API or behavior change; the net9.0 and net10.0 assets are new, and the net8.0 assembly is unchanged. The nuspec no longer declares Microsoft.Extensions.DependencyInjection.Abstractions and Microsoft.Extensions.Options as package dependencies: both assemblies ship in the Microsoft.AspNetCore.App framework reference the package already carries, so consumers are unaffected.