'REST Client for .net core 2

Are there any REST(Http) Client libraries available for .net core 2 like RestSharp..? I have been using RestSharp but it doesn't support .net core 2 so looking for one. Please let me know if you have any suggestions... Thanks in advance..



Solution 1:[1]

Well, have you looked at pre-release packages?

https://www.nuget.org/packages/RestSharp/106.0.0-alpha0284

Solution 2:[2]

Yep.

RestClient.Net

https://github.com/MelbourneDeveloper/RestClient.Net

NuGet: RestClient.Net

It's my library and you can hit me up for support on the repo. Tested heavily on Android, UWP, and .NET Core/Framework.

Solution 3:[3]

I've maintained DalSoft.RestClient since 2015 it works on .NET Standard 2.0 which means it works on full fat .NET and all .NET Core versions - including new .NET Core 2.1 features such as HttpClientFactory.

DalSoft.RestClient is simple but very extensible and flexible, it's actively maintained and battle tested by large enterprises making millions of requests every day.

https://restclient.dalsoft.io/

This is how easy it can be, this gets all my public GitHub repos:

dynamic restClient = new RestClient("https://api.github.com");

var repositories = await restClient
   .Headers(new { UserAgent = "MyClient" } // Github requires User-Agent to be set
   .users.dalsoft.repos.Get();

foreach (var repo in repositories)
{
   Console.WriteLine(repo.name);
}

Live example: https://dotnetfiddle.net/IT3d1E

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Alexey Zimarev
Solution 2
Solution 3 DalSoft