Skip to content

Latest commit

 

History

History
32 lines (26 loc) · 1.17 KB

README.md

File metadata and controls

32 lines (26 loc) · 1.17 KB

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.