Carneiro.Http

Make http requests easy.


Keywords
handler, http, request, csharp, csharp-library, dotnet, dotnet-core, dotnet-standard, http-requests, standard
License
Apache-2.0
Install
Install-Package Carneiro.Http -Version 1.0.1

Documentation

Carneiro Http

GitHub Nuget Nuget

Nuget Package

You can download this package directly from Nuget.org.

How to use

Register HttpOrchestrator with your IServiceCollection from your dotnet core project.

services.RegisterHttpOrchestrator("http://myurl.com/api");

Then you can receive HttpOrchestrator on your ctor in your services or controllers. It's register as transient.

public class AccountController
{
    private readonly HttpOrchestrator _httpOrchestrator;

    public AccountController(HttpOrchestrator httpOrchestrator)
    {
        _httpOrchestrator = httpOrchestrator;
    }

    public async Task<IActionResult> Index()
    {
        User user = await httpOrchestrator.GetAsync<User>("/users/1");
    }
}

In version 2.0.0 HttpOrchestrator works directly with IHttpClientFactory that, on the moment of RegisterHttpOrchestrator registers a http client named HttpOrchestrator.

Changelogs

[3.0.0] - 2019-09-28

  • Drop Newtonsoft.Json nuget dependency;
  • Migrate to dotnet core 3.0.0;

[2.0.0] - 2019-08-16

  • Drop HttpOrchestratorOptions;
  • Drop disposable;
  • Added IHttpClientFactory to manage http client life cycle;

[1.1.0] - 2019-02-04

  • Drop old dependencies;

[1.0.2] - 2019-01-09

  • Add IServiceCollection extensions;

[1.0.1] - 2019-01-08

  • Added Xml comments;
  • Add unit tests;

[1.0.0] - 2019-01-07

  • First release of the library;

Team

Ricardo Carneiro