EasyHttpsClient 1.2.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package EasyHttpsClient --version 1.2.0
                    
NuGet\Install-Package EasyHttpsClient -Version 1.2.0
                    
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="EasyHttpsClient" Version="1.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="EasyHttpsClient" Version="1.2.0" />
                    
Directory.Packages.props
<PackageReference Include="EasyHttpsClient" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add EasyHttpsClient --version 1.2.0
                    
#r "nuget: EasyHttpsClient, 1.2.0"
                    
#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.
#:package EasyHttpsClient@1.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=EasyHttpsClient&version=1.2.0
                    
Install as a Cake Addin
#tool nuget:?package=EasyHttpsClient&version=1.2.0
                    
Install as a Cake Tool

EasyHttpsClient

v1.2.0

EasyHttpsClient is a simple and easy-to-use HTTP client library for .NET. It provides a fluent API for sending HTTP(s) POST and GET requests and retrieving responses.


Usage

GET Request To send a GET request, use the GETasync method:

var client = new HttpsClient();
client.SetUrl("https://example.com/api/data");
await client.GETasync();
var response = await client.ReadResultAsStringAsync();
Console.WriteLine(response);

To send a POST request, use the POSTasync method:

var client = new HttpsClient();
client.SetUrl("https://example.com/api/PostHereFormUrlEncodedData/");
client.SetBodyPostData(new List<KeyValuePair<string, string>>
{
    new KeyValuePair<string, string>("key1", "value1"),
    new KeyValuePair<string, string>("key2", "value2")
});
await client.POSTasync();
var response = await client.ReadResultAsStringAsync();
Console.WriteLine(response);

To send a POST request with a JSON body, use the SetBodyRequestData method

var client = new HttpsClient();
client.SetUrl("https://example.com/api/PostHereInPostBody/");
//example object, it can be any object that can be serialized
var data = new { key1 = "value1", key2 = "value2", ... }; 

client.SetBodyRequestData(data);
// or use client.SetBodyRequestJson(...);

await client.POSTasync();
var response = await client.ReadResultAsStringAsync();
Console.WriteLine(response);

Setting Timeout and Encoding You can set the timeout and encoding for the HTTP client using the SetTimeout and SetEncoding methods:

var client = new HttpsClient();
client.SetTimeout(10); // set timeout to 10 seconds
client.SetEncoding(Encoding.UTF8); // set encoding to UTF-8

Adding Headers You can add headers to the HTTP request using the AddToRequestHeaders method:

var client = new HttpsClient();
client.AddToRequestHeaders("Authorization", "Bearer token ...");

Supports Fluent syntax

HttpsClient client = new EasyHttpsClient.HttpsClient();

await client
    .SetUrl("https://example.com/etc/GetIt.html")
    .SetTimeout(15)
    .SetEncoding(Encoding.UTF8)
    .GETasync();

byte[] bytearray = await client.ReadResultAsByteArrayAsync();
string response = await client.ReadResultAsStringAsync();

Disposing Don't forget to dispose the HTTP client when you're done with it to free up memory:

var client = new HttpsClient();
// ...
client.Dispose();
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.  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. 
.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. 
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
2.0.0 185 9/24/2025
1.2.1 186 9/22/2025
1.2.0 188 9/22/2025
1.0.8 283 3/31/2025
1.0.7 203 8/13/2024
1.0.6 178 8/13/2024
1.0.5 178 8/13/2024
1.0.4 178 8/13/2024
1.0.2 505 10/31/2023
1.0.1 278 10/31/2023