Tag: get
-
RESTSHARP: GET / POST/ DOWNLOAD and UPLOAD with and without Authentication
//GET: var client = new RestClient(“http://www.example.com/”); client.Authenticator = new HttpBasicAuthenticator(“username”, “password”); var request = new RestRequest(URI, Method.GET); request.AddQueryParameter(“id”, customid); var queryResult = client.Execute(request).Content; //POST: var client = new RestClient(“http://www.example.com/”); client.Authenticator = new HttpBasicAuthenticator(“username”, “password”); var request = new RestRequest(URI, Method.POST); request.RequestFormat = DataFormat.Json; request.AddQueryParameter(“id”, customid); request.AddBody(Parameters); IRestResponse response = client.Execute(request); //DOWNLOAD FILE: var client =…