![]() |
VOOZH | about |
dotnet add package Tingle.Extensions.Http --version 5.3.0
NuGet\Install-Package Tingle.Extensions.Http -Version 5.3.0
<PackageReference Include="Tingle.Extensions.Http" Version="5.3.0" />
<PackageVersion Include="Tingle.Extensions.Http" Version="5.3.0" />Directory.Packages.props
<PackageReference Include="Tingle.Extensions.Http" />Project file
paket add Tingle.Extensions.Http --version 5.3.0
#r "nuget: Tingle.Extensions.Http, 5.3.0"
#:package Tingle.Extensions.Http@5.3.0
#addin nuget:?package=Tingle.Extensions.Http&version=5.3.0Install as a Cake Addin
#tool nuget:?package=Tingle.Extensions.Http&version=5.3.0Install as a Cake Tool
This provides a lightweight abstraction around HttpClient which can be used to build custom client with response wrapping semantics.
The default serialization is done using JSON (System.Text.Json) but can be overridden to handle XML, SOAP, or any other formats including just changing the serializer to Newtonsoft.Json.
Below we'll go through some examples of how the AbstractHttpApiClient.
public class Account
{
public string? Id { get; set; }
public string? Name { get; set; }
}
public class MyServiceClient : AbstractApiClient<MyServiceClientOptions>
{
public MyServiceClient(HttpClient client, IOptions<MyServiceClientOptions> optionsAccessor) : base(client, optionsAccessor){}
public async Task<ResourceResponse<Account>> GetAccountAsync(string id, CancellationToken cancellationToken = default)
{
var uri = new Uri(BaseAddress, $"/v1/accounts/{id}");
var request = new HttpRequestMessage(HttpMethod.Get, uri);
return await SendAsync<Account>(request, cancellationToken);
}
// ...
}
public class MyServiceClientOptions : AbstractHttpApiClientOptions { }
Adding to services collection
In Program.cs add the following code snippet:
var builder = Host.CreateApplicationBuilder(args);
builder.Services.AddHttpApiClient<MyServiceClient, MyServiceClientOptions>();
var host = builder.Build();
using var scope = host.Services.CreateScope();
var client = scope.ServiceProvider.GetRequiredService<MyServiceClient>();
var response = await client.GetAccountAsync("123456789");
response.EnsureSuccess(); // throws if not successful
response.EnsureHasResource(); // throws if the response body was empty (null resource)
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 netstandard2.1 is compatible. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 1 NuGet packages that depend on Tingle.Extensions.Http:
| Package | Downloads |
|---|---|
|
Tingle.Extensions.PushNotifications
Clients for sending push notifications via FCM, APNS etc |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 5.3.0 | 448 | 8/26/2025 |
| 5.2.0 | 1,106 | 4/21/2025 |
| 5.1.1 | 296 | 4/20/2025 |
| 5.1.0 | 292 | 4/20/2025 |
| 5.0.1 | 524 | 2/21/2025 |
| 5.0.0 | 430 | 11/19/2024 |
| 4.14.1 | 652 | 10/14/2024 |
| 4.14.0 | 534 | 9/16/2024 |
| 4.13.0 | 834 | 8/13/2024 |
| 4.12.0 | 332 | 8/7/2024 |
| 4.11.2 | 474 | 7/15/2024 |
| 4.11.1 | 537 | 6/26/2024 |
| 4.11.0 | 449 | 6/6/2024 |
| 4.10.1 | 275 | 6/5/2024 |
| 4.10.0 | 340 | 5/27/2024 |
| 4.9.0 | 466 | 5/16/2024 |
| 4.8.0 | 543 | 5/5/2024 |
| 4.7.0 | 729 | 3/25/2024 |
| 4.6.0 | 560 | 3/8/2024 |
| 4.5.0 | 1,602 | 11/22/2023 |