NetPro.NetProShareRequestBody 6.0.9

There is a newer version of this package available.
See the version list below for details.
dotnet add package NetPro.NetProShareRequestBody --version 6.0.9
                    
NuGet\Install-Package NetPro.NetProShareRequestBody -Version 6.0.9
                    
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.9" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NetPro.NetProShareRequestBody" Version="6.0.9" />
                    
Directory.Packages.props
<PackageReference Include="NetPro.NetProShareRequestBody" />
                    
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 NetPro.NetProShareRequestBody --version 6.0.9
                    
#r "nuget: NetPro.NetProShareRequestBody, 6.0.9"
                    
#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 NetPro.NetProShareRequestBody@6.0.9
                    
#: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=NetPro.NetProShareRequestBody&version=6.0.9
                    
Install as a Cake Addin
#tool nuget:?package=NetPro.NetProShareRequestBody&version=6.0.9
                    
Install as a Cake Tool

ShareRequestData使用

NuGet

[废弃]

共享请求何响应中的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 Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  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.  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 netcoreapp3.1 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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 426 7/24/2023
6.0.15 1,017 7/19/2022
6.0.14 1,001 7/10/2022
6.0.13 1,064 6/15/2022
6.0.12 1,006 6/15/2022
6.0.11 969 6/15/2022
6.0.10 975 6/11/2022
6.0.9 1,015 6/8/2022
6.0.8 982 5/26/2022
6.0.8-beta.3 221 5/24/2022
6.0.8-beta.2 220 5/24/2022
6.0.7 1,003 5/18/2022
6.0.6 1,009 4/28/2022
6.0.5 1,011 3/30/2022
6.0.5-beta.20 221 4/27/2022
6.0.5-beta.19 250 4/25/2022
6.0.5-beta.18 221 4/22/2022
6.0.5-beta.17 236 4/16/2022
6.0.5-beta.16 230 4/8/2022
6.0.5-beta.15 238 4/8/2022
6.0.5-beta.14 243 4/7/2022
6.0.5-beta.13 240 4/7/2022
6.0.5-beta.12 225 4/6/2022
6.0.5-beta.11 232 4/6/2022
6.0.5-beta.10 233 3/31/2022
6.0.5-beta.9 245 3/26/2022
6.0.5-beta.8 266 3/22/2022
6.0.5-beta.7 231 3/21/2022
6.0.5-beta.6 237 3/14/2022
6.0.5-beta.5 235 3/2/2022
6.0.5-beta.4 273 2/22/2022
6.0.5-beta.3 246 2/18/2022
6.0.5-beta.2 235 2/18/2022
6.0.5-beta.1 245 2/16/2022
6.0.4 847 2/10/2022
6.0.3 831 2/9/2022
6.0.3-beta.9 259 2/10/2022
6.0.3-beta.7 249 1/27/2022
6.0.3-beta.6 264 1/19/2022
6.0.3-beta.5 257 1/17/2022
6.0.3-beta.4 257 1/16/2022
6.0.3-beta.3 261 1/14/2022
6.0.3-beta.2 261 1/13/2022
6.0.3-beta.1 299 1/11/2022
6.0.2 723 1/6/2022
6.0.1 1,433 12/3/2021
3.1.11 932 11/17/2021
3.1.10 2,207 7/29/2021
3.1.9 2,022 7/1/2021
3.1.8 2,024 12/15/2020
3.1.6 2,226 9/16/2020
3.1.5 2,084 9/8/2020