Library to make RESTful calls in .NET applications.
- Create REST caller
var caller = new RESTCaller();
- Make GET RESTfull call
// Making GET call to https://jsonplaceholder.typicode.com/posts?userId=1
var getResponse = await caller.GetAsync(
uri: new Uri("https://jsonplaceholder.typicode.com/posts"),
parameters: new Dictionary<string, string>
{
{"userId", "1"}
});
- Make POST RESTfull call
// Making GET call to https://jsonplaceholder.typicode.com/posts
var postResponse = await caller.PostAsync(
uri: new Uri("https://jsonplaceholder.typicode.com/posts"),
body: @"{ ""title"": ""foo"", ""body"": ""bar"", ""userId"": 1 }");
Please refer to IRESTCaller
and RESTCallerExtensions
for more details.