NetPro.NetProShareRequestBody
6.0.3-beta.3
This is a prerelease version of NetPro.NetProShareRequestBody.
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package NetPro.NetProShareRequestBody --version 6.0.3-beta.3
NuGet\Install-Package NetPro.NetProShareRequestBody -Version 6.0.3-beta.3
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="NetPro.NetProShareRequestBody" Version="6.0.3-beta.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add NetPro.NetProShareRequestBody --version 6.0.3-beta.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: NetPro.NetProShareRequestBody, 6.0.3-beta.3"
#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.
// Install NetPro.NetProShareRequestBody as a Cake Addin #addin nuget:?package=NetPro.NetProShareRequestBody&version=6.0.3-beta.3&prerelease // Install NetPro.NetProShareRequestBody as a Cake Tool #tool nuget:?package=NetPro.NetProShareRequestBody&version=6.0.3-beta.3&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
ShareRequestData使用
共享请求何响应中的body,避免各中间件重复解析body流。 特别注意:ResponseCacheData生命周期为scope
使用
启用服务
public void ConfigureServices(IServiceCollection services)
{
services.AddShareRequestBody();//用户共享存放中间件读取的body
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
//应放于所有中间价最上层
application.UseShareRequestBody();
}
获取当前请求body
- 构造函数注入
private readonly RequestCacheData _requestCacheData;
public XXXController(RequestCacheData requestCacheData)
{
_requestCacheData = requestCacheData;
}
Console.Write(_requestCacheData.Body);
- 通过
IServiceProvider
获取RequestCacheData 对象
private readonly RequestCacheData _requestCacheData;
public XXXController(IServiceProvider _serviceProvider)
{
_requestCacheData =_serviceProvider.GetService<ResponseCacheOption>()
}
Console.Write(_requestCacheData.Body);
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. 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 was computed. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net6.0
- NetPro.Startup (>= 6.0.3-beta.3)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on NetPro.NetProShareRequestBody:
Package | Downloads |
---|---|
NetPro.Sign
Package Description |
|
NetPro.ResponseCache
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
6.0.16 | 268 | 7/24/2023 |
6.0.15 | 868 | 7/19/2022 |
6.0.14 | 841 | 7/10/2022 |
6.0.13 | 898 | 6/15/2022 |
6.0.12 | 846 | 6/15/2022 |
6.0.11 | 815 | 6/15/2022 |
6.0.10 | 825 | 6/11/2022 |
6.0.9 | 826 | 6/8/2022 |
6.0.8 | 832 | 5/26/2022 |
6.0.8-beta.3 | 114 | 5/24/2022 |
6.0.8-beta.2 | 111 | 5/24/2022 |
6.0.7 | 830 | 5/18/2022 |
6.0.6 | 847 | 4/28/2022 |
6.0.5 | 843 | 3/30/2022 |
6.0.5-beta.20 | 116 | 4/27/2022 |
6.0.5-beta.19 | 116 | 4/25/2022 |
6.0.5-beta.18 | 113 | 4/22/2022 |
6.0.5-beta.17 | 124 | 4/16/2022 |
6.0.5-beta.16 | 124 | 4/8/2022 |
6.0.5-beta.15 | 125 | 4/8/2022 |
6.0.5-beta.14 | 128 | 4/7/2022 |
6.0.5-beta.13 | 131 | 4/7/2022 |
6.0.5-beta.12 | 117 | 4/6/2022 |
6.0.5-beta.11 | 116 | 4/6/2022 |
6.0.5-beta.10 | 123 | 3/31/2022 |
6.0.5-beta.9 | 132 | 3/26/2022 |
6.0.5-beta.8 | 125 | 3/22/2022 |
6.0.5-beta.7 | 122 | 3/21/2022 |
6.0.5-beta.6 | 120 | 3/14/2022 |
6.0.5-beta.5 | 123 | 3/2/2022 |
6.0.5-beta.4 | 125 | 2/22/2022 |
6.0.5-beta.3 | 124 | 2/18/2022 |
6.0.5-beta.2 | 119 | 2/18/2022 |
6.0.5-beta.1 | 124 | 2/16/2022 |
6.0.4 | 694 | 2/10/2022 |
6.0.3 | 663 | 2/9/2022 |
6.0.3-beta.9 | 119 | 2/10/2022 |
6.0.3-beta.7 | 130 | 1/27/2022 |
6.0.3-beta.6 | 136 | 1/19/2022 |
6.0.3-beta.5 | 130 | 1/17/2022 |
6.0.3-beta.4 | 141 | 1/16/2022 |
6.0.3-beta.3 | 143 | 1/14/2022 |
6.0.3-beta.2 | 140 | 1/13/2022 |
6.0.3-beta.1 | 179 | 1/11/2022 |
6.0.2 | 529 | 1/6/2022 |
6.0.1 | 1,255 | 12/3/2021 |
3.1.11 | 751 | 11/17/2021 |
3.1.10 | 2,019 | 7/29/2021 |
3.1.9 | 1,833 | 7/1/2021 |
3.1.8 | 1,800 | 12/15/2020 |
3.1.6 | 1,973 | 9/16/2020 |
3.1.5 | 1,863 | 9/8/2020 |