public async static Task<String> CallApi(List<KeyValuePair<string, string>> datosPost)
{
string uri = "http://api/";
var httpClient = new HttpClient();
HttpContent parametros = new FormUrlEncodedContent(datosPost);
var response = await httpClient.PostAsync(uri, parametros);
response.EnsureSuccessStatusCode();
string json = await response.Content.ReadAsStringAsync();
return json;
}
Making a POST request to a windows phone API
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.