Created
June 12, 2018 17:56
-
-
Save GregTrevellick/95957f644bcc93c414a4d2b6069385b2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//GET: | |
var client = new RestClient("192.168.0.1"); | |
var request = new RestRequest("api/item/", Method.GET); | |
var queryResult = client.Execute<List<Items>>(request).Data; | |
//POST: | |
var client = new RestClient("http://192.168.0.1"); | |
var request = new RestRequest("api/item/", Method.POST); | |
request.RequestFormat = DataFormat.Json; | |
request.AddBody(new Item | |
{ | |
ItemName = someName, | |
Price = 19.99 | |
}); | |
client.Execute(request); | |
//https://stackoverflow.com/questions/10226089/restsharp-simple-complete-example?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa | |
//http://pawel.sawicz.eu/restsharp/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment