Tingle.Extensions.Http
                              
                            
                                5.3.0
                            
                        
                    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" />
<PackageReference Include="Tingle.Extensions.Http" />
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.0
#tool nuget:?package=Tingle.Extensions.Http&version=5.3.0
Tingle.Extensions.Http
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 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 is compatible. 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 is compatible. 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.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. | 
- 
                                                    
.NETStandard 2.1
- Microsoft.Extensions.Http (>= 9.0.8)
 - System.Net.Http.Json (>= 9.0.8)
 
 - 
                                                    
net8.0
- Microsoft.Extensions.Http (>= 9.0.8)
 - System.Net.Http.Json (>= 9.0.8)
 
 - 
                                                    
net9.0
- Microsoft.Extensions.Http (>= 9.0.8)
 
 
NuGet packages (1)
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  | 
                                                    
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated | 
|---|---|---|
| 5.3.0 | 367 | 8/26/2025 | 
| 5.2.0 | 1,044 | 4/21/2025 | 
| 5.1.1 | 227 | 4/20/2025 | 
| 5.1.0 | 221 | 4/20/2025 | 
| 5.0.1 | 459 | 2/21/2025 | 
| 5.0.0 | 358 | 11/19/2024 | 
| 4.14.1 | 563 | 10/14/2024 | 
| 4.14.0 | 465 | 9/16/2024 | 
| 4.13.0 | 763 | 8/13/2024 | 
| 4.12.0 | 270 | 8/7/2024 | 
| 4.11.2 | 406 | 7/15/2024 | 
| 4.11.1 | 477 | 6/26/2024 | 
| 4.11.0 | 388 | 6/6/2024 | 
| 4.10.1 | 206 | 6/5/2024 | 
| 4.10.0 | 280 | 5/27/2024 | 
| 4.9.0 | 392 | 5/16/2024 | 
| 4.8.0 | 470 | 5/5/2024 | 
| 4.7.0 | 667 | 3/25/2024 | 
| 4.6.0 | 488 | 3/8/2024 | 
| 4.5.0 | 1,560 | 11/22/2023 | 
| 4.4.1 | 362 | 11/20/2023 | 
| 4.4.0 | 305 | 11/15/2023 | 
| 4.3.0 | 725 | 10/18/2023 |