试试这个
using System.Net.Http;
protected async override void OnNavigatedTo(NavigationEventArgs e)
{
var data = new List<KeyValuePair<string, string>>
{
new KeyValuePair<string, string>("key_1", "value_1"),
new KeyValuePair<string, string>("key_2", "value_1")
};
await PostKeyValueData(data);
}
private async Task PostKeyValueData(List<KeyValuePair<string, string>> values)
{
var httpClient = new HttpClient();
var response = await httpClient.PostAsync("http://50.16.234.220/helloapp/api/public/", new FormUrlEncodedContent(values));
var responseString = await response.Content.ReadAsStringAsync();
}