Cinch.HTTipi 1.1.0

HttpClient extension methods to make HTTP Requests simpler.

Install-Package Cinch.HTTipi -Version 1.1.0
dotnet add package Cinch.HTTipi --version 1.1.0
paket add Cinch.HTTipi --version 1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

httipi

A .NET Standard compliant set of extenions methods for System.Net.HttpClient that makes making HTTP requests much much simpler. Includes a fluent HttpRequestMessage builder.

Compression is automatically enabled if available (from response headers) and streams are used throughout the stack to ensure large requests are handled appropriately.

NuGet Version
Build Status

Getting Started

A simple example to execute a GET request deserializing JSON to CLR object using Json.NET

var http = new HttpClient();
var someObject = JsonConvert.DeserializeObject(await http.GetString("http://someurl.com"));

A more complex PATCH request with a JSON request body and an HMAC authorization header.

var http = new HTTipi();
string json = JsonConvert.SerializeObject(new { someProperty = "newPropertyValue" }); 

var req = new HTTipiRequestBuilder().SetUrl("http://someurl.com")
                                    .SetMethod(new HttpMethod("PATCH"))
                                    .WithContent(new StringContent(json, Encoding.UTF8, "application/json"))
                                    .AddHeader("Authorization", "hmac somecrazylonghmackey")

await Execute(req);

Exception handling.

var http = new HttpClient();

try
{
  var someObject = JsonConvert.DeserializeObject(await http.GetString("http://someurl.com"));
}
catch (HTTipiException ex)
{
  //logging
}

httipi

A .NET Standard compliant set of extenions methods for System.Net.HttpClient that makes making HTTP requests much much simpler. Includes a fluent HttpRequestMessage builder.

Compression is automatically enabled if available (from response headers) and streams are used throughout the stack to ensure large requests are handled appropriately.

NuGet Version
Build Status

Getting Started

A simple example to execute a GET request deserializing JSON to CLR object using Json.NET

var http = new HttpClient();
var someObject = JsonConvert.DeserializeObject(await http.GetString("http://someurl.com"));

A more complex PATCH request with a JSON request body and an HMAC authorization header.

var http = new HTTipi();
string json = JsonConvert.SerializeObject(new { someProperty = "newPropertyValue" }); 

var req = new HTTipiRequestBuilder().SetUrl("http://someurl.com")
                                    .SetMethod(new HttpMethod("PATCH"))
                                    .WithContent(new StringContent(json, Encoding.UTF8, "application/json"))
                                    .AddHeader("Authorization", "hmac somecrazylonghmackey")

await Execute(req);

Exception handling.

var http = new HttpClient();

try
{
  var someObject = JsonConvert.DeserializeObject(await http.GetString("http://someurl.com"));
}
catch (HTTipiException ex)
{
  //logging
}

Release Notes

BREAKING CHANGES:

  • .NETStandard 2.0

    • No dependencies.

Version History

Version Downloads Last updated
1.1.0 102 2/8/2018
1.0.10 108 9/26/2017
1.0.9 90 9/26/2017
1.0.8 119 9/20/2017
1.0.7 95 9/14/2017
1.0.6 90 9/12/2017
1.0.5 89 9/12/2017
1.0.4 91 9/12/2017
1.0.3 92 9/11/2017
1.0.2 96 9/5/2017
1.0.1 93 9/5/2017
1.0.0 95 9/5/2017