Skip to content

sudeshgutta/SingleFuncRest

Repository files navigation

SingleFuncRest

An easy to use wrapper for HTTP/Rest API consumption in C#

License: Apache License 2.0

It's a wrapper over RestSharp (https://github.com/restsharp/RestSharp) which provides users an easy to use interface to perform HTTP requests and to read their responses


Example Usage :

IRestServices restServices = new RestServices();
string url = "http://localhost"
Dictionary<string,string> para = new Dictionary<string,string>();
para.Add("param1","param1");
para.Add("param2","param2");
string response = restServices.HttpGet(url, para);

Request parameters have to be passed as key <-> value pairs encapsulated within a dictionary object

At the current moment have implemented the wrapper for basic HTTP GET and POST requests, more work is in progress to enable consumption of rest services easily with a single function call.