Skip to content

jpenniman/rest-caller

 
 

Repository files navigation

REST Caller

NuGet Version NuGet Downloads

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.

About

Library to make RESTful calls in .NET applications.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%