Skip to content

Mirch/RequestManager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Request Manager

RequestManager is a .NET Core library that provides helper methods to easily send requests in different formats and deserialize the response into objects.

You can install the library from NuGet.

Build status

Build Status

Features

RequestManager handles the requests by reusing the same HttpClient object when the requests are sent to the same API. For multiple APIs, the HttpClient objects will be saved and reused in the proper situation.

The library can send GET, POST, PUT, PATCH and DELETE requests with JSON, XML or form-data content types, and receive any type of response, with the possibility to translate it from JSON and XML.

How to use?

Sending a request and reading the response

var postAndGetJsonResponse = (await _requestSender.PostAsync("/api/test/json",
                                                             new Person() { Id = 2, Name = "John" }))
                             .ResultAs<Person>(ContentType.JSON);

You can take a look at the HomeController from the Sandbox project for more examples regarding sending different content types.

About

Managing HTTP requests in ASP.NET Core

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published