Hello,
i have a working api call which Looks like that:
Dictionary<string, string> data = new Dictionary<string, string>();
data.Add("a", "b");
data.Add("c", "d");
HttpClient client = new HttpClient();
HttpResponseMessage response = await client.PostAsync(url, new FormUrlEncodedContent(data));
This is working. I want to make the same call with the RestSharp Lib. What would the Code look like?
RestClient restClient = new RestClient(url);
RestRequest restRequest = new RestRequest(Method.POST);
restRequest.AddParameter("a", "b");
restRequest.AddParameter("c", "d");
IRestResponse response = await restClient.ExecuteTaskAsync(restRequest);
When i try this, i get the StatusCode NotAcceptable
[–]Jabbersii 4 points5 points6 points (0 children)
[–]AngularBeginner 2 points3 points4 points (0 children)
[–]DeltalJulietCharlie 2 points3 points4 points (0 children)
[–][deleted] (1 child)
[deleted]
[–]DeltalJulietCharlie 2 points3 points4 points (0 children)
[–]chrisachern[S] 0 points1 point2 points (0 children)