Netified.LicenseManager.Api.Client
1.2.5
See the version list below for details.
dotnet add package Netified.LicenseManager.Api.Client --version 1.2.5
NuGet\Install-Package Netified.LicenseManager.Api.Client -Version 1.2.5
<PackageReference Include="Netified.LicenseManager.Api.Client" Version="1.2.5" />
paket add Netified.LicenseManager.Api.Client --version 1.2.5
#r "nuget: Netified.LicenseManager.Api.Client, 1.2.5"
// Install Netified.LicenseManager.Api.Client as a Cake Addin #addin nuget:?package=Netified.LicenseManager.Api.Client&version=1.2.5 // Install Netified.LicenseManager.Api.Client as a Cake Tool #tool nuget:?package=Netified.LicenseManager.Api.Client&version=1.2.5
Netified.LicenseManager.Api.Client
A .NET Standard and .NET Core License Manager REST API toolkit and API wrapper.
Installation
The library is available as a nuget package. You can install it as any other nuget package from your IDE, try to search by Netified.LicenseManager.Api.Client
. You can find package details on this web page.
// Package Manager
Install-Package Netified.LicenseManager.Api.Client
// .NET CLI
dotnet add package Netified.LicenseManager.Api.Client
// Package reference in .csproj file
<PackageReference Include="Netified.LicenseManager.Api.Client" Version="1.0.0" />
Then add the following to your ConfigureServices method.
services.AddLicenseManagerClient<MyAPIHandler>(Configuration)
The following are required in app settings if you are not using an official installation:
"ApiClientConfiguration":{
"BaseAddress": "https://api.netified.io/license-manager/v1/"
}
Configuration
By default API requests to License Manager must be authenticated, you can find below an handler to add authentication on your API requests.
public class MyAPIHandler : DelegatingHandler
{
private readonly IHttpContextAccessor _httpContextAccessor;
private readonly ILogger<MyAPIHandler> _logger;
/// <summary>
/// Initializes a new instance of the <see cref="MyAPIHandler"/> class.
/// </summary>
/// <param name="httpContextAccessor">The HTTP context accessor.</param>
/// <param name="logger">The logger.</param>
public MyAPIHandler(IHttpContextAccessor httpContextAccessor, ILogger<MyAPIHandler> logger)
{
_httpContextAccessor = httpContextAccessor;
_logger = logger;
}
/// <summary>
/// Sends an HTTP request to the inner handler to send to the server as an asynchronous operation.
/// </summary>
/// <param name="request">The HTTP request message to send to the server.</param>
/// <param name="cancellationToken">A cancellation token to cancel operation.</param>
/// <returns>
/// The task object representing the asynchronous operation.
/// </returns>
protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
{
HttpResponseMessage responseMessage;
try
{
var accessToken = await _httpContextAccessor.HttpContext!.GetTokenAsync("access_token");
if (string.IsNullOrEmpty(accessToken))
throw new Exception($"Access token is missing for the request {request.RequestUri}");
request.Headers.Authorization = new AuthenticationHeaderValue("bearer", accessToken);
responseMessage = await base.SendAsync(request, cancellationToken);
responseMessage.EnsureSuccessStatusCode();
}
catch (Exception ex)
{
_logger.LogError(ex, "Failed to run http query {RequestUri}", request.RequestUri);
throw;
}
return responseMessage;
}
}
Please show the value
Choosing a project dependency could be difficult. We need to ensure stability and maintainability of our projects. Surveys show that GitHub stars count play an important factor when assessing library quality.
⭐ Please give this repository a star. It takes seconds and help thousands of developers! ⭐
Support development
It doesn't matter if you are a professional developer, creating a startup or work for an established company. All of us care about our tools and dependencies, about stability and security, about time and money we can safe, about quality we can offer. Please consider sponsoring to give me an extra motivational push to develop the next great feature.
If you represent a company, want to help the entire community and show that you care, please consider sponsoring using one of the higher tiers. Your company logo will be shown here for all developers, building a strong positive relation.
How to Contribute
Everyone is welcome to contribute to this project! Feel free to contribute with pull requests, bug reports or enhancement suggestions.
Bugs and Feedback
For bugs, questions and discussions please use the GitHub Issues.
License
This project is licensed under MIT License.
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 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. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. 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.0
- Microsoft.Extensions.Configuration.Binder (>= 6.0.0)
- Microsoft.Extensions.Http.Polly (>= 6.0.8)
- Netified.LicenseManager.Api.Abstractions (>= 1.8.0)
- Polly (>= 7.2.3)
- Polly.Extensions.Http (>= 3.0.0)
- Refit (>= 6.3.2)
- Refit.HttpClientFactory (>= 6.3.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.