Sparkdo.Mediation.Http 2.0.0-preview.2

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

Sparkdo.Mediation.Http

Sparkdo.Mediation.Http 为 Mediation 提供直接基于平台 IHttpClientFactory 的 HTTP transport。它包含 IHttpRequest<TResponse>HttpRequest<TResponse>SdkHttpRequest<TResponse>、三个 HTTP context 与开放泛型 HttpRequestHandler<,>

dotnet add package Sparkdo.Mediation.Http

最小请求:

using Sparkdo.Mediation.Http;

public sealed class HealthRequest : HttpRequest<string>
{
    public override ValueTask Request(HttpRequestContext context)
    {
        context.Message.Method = HttpMethod.Get;
        context.Message.RequestUri = new Uri("health", UriKind.Relative);
        return default;
    }

    public override async ValueTask<string> Response(HttpResponseContext context) =>
        await context.Message.Content
            .ReadAsStringAsync(context.CancellationToken)
            .ConfigureAwait(false);
}

执行顺序固定为 CreateClient -> Request -> SendAsync -> Response。默认 client 名为 Sparkdo.Mediation.Http,可覆盖 CreateClient 选择自定义 named client。SdkHttpRequest<TResponse> 只初始化日志与 IJsonSerializer 并提供四个 hook;它不会自动调用 EnsureSuccessStatusCode(),也不会自动反序列化响应。

完整的默认/custom client、SDK JSON、资源释放与 generated generic closure 说明见 Mediation 用户指南,包资产规则见包边界文档

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

Showing the top 5 NuGet packages that depend on Sparkdo.Mediation.Http:

Package Downloads
Sparkdo.Weixin

Sparkdo 微信SDK核心库,提供微信开发的基础功能和核心组件

Sparkdo.Weixin.Payment

library for the Sparkdo framework

MYDev.Uniproud

.NET SDK for 傲融云客 系统,提供客户管理、项目管理、短信服务、余额查询等核心业务功能。

MYDev.Fadada

.NET SDK for 法大大 (Fadada) 电子签章服务,提供企业级电子合同签署解决方案。支持企业成员管理、文件处理、印章管理、签署任务等核心功能。

MYDev.XunZhongSms

.NET SDK for 讯众短信服务,提供企业级短信发送解决方案。支持营销类和通知类短信发送。

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.0-preview.2 46 7/20/2026
2.0.0-preview.1 44 7/18/2026
1.0.4-preview.3 88 6/8/2026
1.0.4-preview.2 78 6/7/2026
1.0.4-preview.1 87 6/7/2026
1.0.3 177 6/6/2026
1.0.3-preview.1 134 5/17/2026