HttpClientLibrary.04.17.24.001
1.0.0
dotnet add package HttpClientLibrary.04.17.24.001 --version 1.0.0
NuGet\Install-Package HttpClientLibrary.04.17.24.001 -Version 1.0.0
<PackageReference Include="HttpClientLibrary.04.17.24.001" Version="1.0.0" />
<PackageVersion Include="HttpClientLibrary.04.17.24.001" Version="1.0.0" />
<PackageReference Include="HttpClientLibrary.04.17.24.001" />
paket add HttpClientLibrary.04.17.24.001 --version 1.0.0
#r "nuget: HttpClientLibrary.04.17.24.001, 1.0.0"
#:package HttpClientLibrary.04.17.24.001@1.0.0
#addin nuget:?package=HttpClientLibrary.04.17.24.001&version=1.0.0
#tool nuget:?package=HttpClientLibrary.04.17.24.001&version=1.0.0
HttpClientHelper NuGet Package
Overview
The HttpClientHelper NuGet package provides a convenient wrapper around the HttpClient
class for making HTTP requests in .NET applications. It simplifies common HTTP operations such as GET, POST, PUT, and DELETE requests, as well as handling access token retrieval.
Features
- GET Request: Retrieve data from a specified URI.
- POST Request: Send data to a specified URI.
- PUT Request: Update data at a specified URI.
- DELETE Request: Delete data at a specified URI.
- Access Token Retrieval: Obtain access tokens using various grant types.
Installation
You can install the HttpClientHelper NuGet package via NuGet Package Manager or NuGet CLI:
Package Manager:
Install-Package HttpClientLibrary.04.17.24.001
.NET CLI:
dotnet add package HttpClientLibrary.04.17.24.001
Usage
Basic Usage:
using HttpClientHelper;
// Create an instance of HttpClientHelper
var httpClientHelper = new HttpClientHelper(new HttpClient());
// Send a GET request
var data = await httpClientHelper.HttpRetrieveAllAsync<T>("https://api.example.com/data");
// Send a POST request
var model = new YourModel();
var postResponse = await httpClientHelper.HttpPostAsync("https://api.example.com/resource", model);
// Send a PUT request
var putResponse = await httpClientHelper.HttpPutAsync("https://api.example.com/resource/123", model);
// Send a DELETE request
var deleteResponse = await httpClientHelper.HttpDeleteAsync("https://api.example.com/resource/123");
Access Token Retrieval:
using HttpClientHelper;
// Create an instance of HttpClientHelper
var httpClientHelper = new HttpClientHelper(new HttpClient());
// Define your access token model
var accessTokenModel = new AccessTokenModel
{
Username = "your_username",
Password = "your_password",
GrantType = "password",
RequestUrl = "https://api.example.com/token"
};
// Retrieve access token
var accessTokenResponse = await httpClientHelper.HttpRetrieveAccessTokenAsync(accessTokenModel);
Contributions
Contributions are welcome! If you encounter any issues or have suggestions for improvements, please feel free to open an issue or create a pull request on GitHub.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Feel free to customize this template according to your specific requirements and add any additional information you find necessary.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | 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 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. |
-
net8.0
- Microsoft.Extensions.Http (>= 8.0.0)
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.0.0 | 148 | 4/17/2024 |