Skip to content

TheMofaDe/DotNetHelper-HttpClient

Repository files navigation

DotNetHelper-HttpClient

DotNetHelper-HttpClient is a simple lightweight library for executing restful requests. Easy Integration with polly. Support both asynchronous and synchronous operation

|| Change Log • || View on Github||

Package Tests Code Coverage
Build Status Build Status codecov
Continous Integration Windows Linux MacOS
AppVeyor Build status
Azure Devops Build Status Build Status Build Status

Features

  • All apis are available in both asynchronous and synchronous operation

Get string from rest api

var client = new RestClient();
var json = client.GetString($"https://jsonplaceholder.typicode.com/todos/1",  Method.Get);

Get Stream from rest api

var client = new RestClient();
var stream = client.GetStream($"https://jsonplaceholder.typicode.com/todos/1",  Method.Get);

Get bytes[] from rest api

var client = new RestClient();
var bytes = client.GetBytes($"https://jsonplaceholder.typicode.com/todos/1",  Method.Get);

Get HttpResponseMessage from rest api

var client = new RestClient();
var httpResponse = client.GetHttpResponse($"https://jsonplaceholder.typicode.com/todos/1",  Method.Get);

Get Generic Type from rest api

var client = new RestClient();
// The first parameter takes a Func<string, T> this allows you to implement your own deserializer 
// In doing so this will prevent the library from needing to depending on third party libraries for serialization 
var employee = client.Get(JsonConvert.DeserializeObject<Employee>,$"https://jsonplaceholder.typicode.com/todos/1", Method.Get);

Documentation

For more information, please refer to the Officials Docs

Solution Template

badge

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages