Token.HttpClientHelper 1.2.2

dotnet add package Token.HttpClientHelper --version 1.2.2                
NuGet\Install-Package Token.HttpClientHelper -Version 1.2.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="Token.HttpClientHelper" Version="1.2.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Token.HttpClientHelper --version 1.2.2                
#r "nuget: Token.HttpClientHelper, 1.2.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.
// Install Token.HttpClientHelper as a Cake Addin
#addin nuget:?package=Token.HttpClientHelper&version=1.2.2

// Install Token.HttpClientHelper as a Cake Tool
#tool nuget:?package=Token.HttpClientHelper&version=1.2.2                

工具合集

介绍

为了简化一些代码封装了适合小项目使用的工具包

http工具

  1. HttpClientHelper
//先注入工具 工具使用的是单例生命周期
service.AddTokenHttpHelperInject("http://localhost:5104/");
...

//使用工具前先注入工具
private readonly TokenHttp _tokenHttp;
	public DemoService(TokenHttp tokenHttp){
		_tokenHttp=tokenHttp;
	}
...

//使用工具
var result= _tokenHttp.GetAsync("/api/demo");


自动注入工具

2.Inject

// 你需要注入的项目的程序集,一个项目只需要一个即可
services.AddAutoInject(typeof(DemoModule));

...

//使用工具  继承ITransientTag 将使用Transient生命周期 
// IScopedTag ITransientTag ISingletonTag 三种生命周期标志,继承不同接口生命周期也不同
public class DemoService:ITransientTag
{
}


Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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
1.2.2 451 6/17/2022
1.2.1 396 6/17/2022
1.2.0 417 5/28/2022
1.1.8 416 5/28/2022
1.1.5 410 5/22/2022
1.1.0 425 5/13/2022
1.0.10 435 5/8/2022
1.0.9 399 5/8/2022
1.0.8 401 5/8/2022
1.0.5 379 5/8/2022
1.0.0 405 5/7/2022

增加post接口返回stream,修改统一使用的接口返回的参数