Opx.HttpClient 1.1.0

dotnet add package Opx.HttpClient --version 1.1.0
                    
NuGet\Install-Package Opx.HttpClient -Version 1.1.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="Opx.HttpClient" Version="1.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Opx.HttpClient" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Opx.HttpClient" />
                    
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 Opx.HttpClient --version 1.1.0
                    
#r "nuget: Opx.HttpClient, 1.1.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 Opx.HttpClient@1.1.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=Opx.HttpClient&version=1.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Opx.HttpClient&version=1.1.0
                    
Install as a Cake Tool

Opx.HttpClient

HTTP Client tools, simplify HttpClient.

NuGet version (Opx.HttpClient)

Usage

Basic

var api = new ApiRequest("https://localhost");

// https://localhost/customers
var customers = await api.RequestJsonAsync<List<Customer>>(HttpMethod.Post, "customers");

Parameter From Query

// https://localhost/customers?Active=true&Sort=name
var customers = await api.RequestJsonAsync<List<Customer>>(HttpMethod.Get, "customers", new ApiRequestParameter()
{
    FromQuery = new
    {
        Active = true,
        Sort = "name"
    }
);

Parameter From Route

// https://localhost/customers/1
var customer = await api.RequestJsonAsync<Customer>(HttpMethod.Get, "customers/{Id}", new ApiRequestParameter()
{
    FromRoute = new
    {
        Id = 1
    }
);

Parameter From Body

// https://localhost/customers/save
var success = await api.RequestJsonAsync<bool>(HttpMethod.Post, "customers/save", new ApiRequestParameter()
{
    FromBody = new
    {
        Id = 1,
        FirstName = "John",
        LastName = "Doe"
    }
);

You can mix those parameters together.

HTTP Request Version

Default RequestVersion is HTTP/2

var doc = new DocRequest("https://tools.keycdn.com/http2-test", HttpRequestVersion.Http20);
var res = doc.RequestString(HttpMethod.Get);

For HTTP/3 you must set httpVersionPolicy to HttpVersionPolicy.RequestVersionExact

var doc = new DocRequest("https://cloudflare-quic.com", HttpRequestVersion.Http30, HttpVersionPolicy.RequestVersionExact);
var res = doc.RequestString(HttpMethod.Get);
Product Compatible and additional computed target framework versions.
.NET 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 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Opx.HttpClient:

Package Downloads
Opx.LApis

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.0 106 4/1/2026
1.0.9 130 1/8/2026
1.0.8 122 1/8/2026
1.0.7 121 1/7/2026
1.0.6 119 1/7/2026
1.0.5 215 12/23/2025
1.0.4 253 5/27/2025
1.0.3 184 11/19/2024
1.0.2 223 10/4/2024
1.0.1 198 10/3/2024
1.0.0 174 10/3/2024