I am able to send a POST request with string parameters to an URL using the System.Web.HttpClient like so:
// Create the HTTPClient
HttpClient httpClient = new HttpClient();
// Add string parameters
FormUrlEncodedContent content = new FormUrlEncodedContent(new[] {
new KeyValuePair<string, string>("client_id", "myclientid),
new KeyValuePair<string, string>("serial_number", "myserialnumber)
});
// Make the call
HttpResponseMessage response = await httpClient.PostAsync(_requestUri, content);
However, I want to do the same, but with the Windows.Web.HttpClient class.
The main difference is that the PostAsync method accepts an HttpContent as the second argument, so my FormUrlEncodedContent does not work. Also I cannot create an IHttpContent with JSON since I need to pass string parameters.
Any thoughts?