Ybd.AbpLite.UnifiedResponse.Client 2.0.0

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

Ybd.AbpLite.UnifiedResponse.Client

配合 Ybd.AbpLite.UnifiedResponse 使用的 ABP 客户端包。

服务端默认返回统一信封:

{ "success": true, "data": { "id": "...", "name": "DDD" } }

ABP 动态客户端的接口契约是裸 DTO(Task<BookDto>),它不会自动解信封。本包给所有 ABP 动态代理请求加:

X-Unified-Response: native

服务端看到这个头后返回裸 DTO 和 ABP 原生错误,动态代理就能按契约正常反序列化。

使用

[DependsOn(typeof(AbpLiteUnifiedResponseClientModule))]
public class MyClientModule : AbpModule
{
}

如果只需要给某个自定义 HttpClient 加头:

services.AddHttpClient("my-client")
    .AddAbpLiteNativeResponseHeader();

说明

  • 只对 ABP 动态代理 / 显式使用本包 Handler 的客户端生效;
  • 服务端必须开启 UnifiedResponse:AllowNativeOverride(默认开启);
  • 服务端 Mode=Native 时本来就不包装,这个头不会产生副作用;
  • 不使用 ABP 动态代理、而是手写 axios/fetch 的前端,不需要引用本包。
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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.0 90 10/29/2026
1.0.0 110 10/26/2026