【发布时间】:2013-12-24 15:40:33
【问题描述】:
我已经使用 POST 方法管理发送值,如下所示。
var values = new List<KeyValuePair<string, string>>
{
new KeyValuePair<string, string>("username", "user"),
new KeyValuePair<string, string>("password", "password"),
}; var client = new HttpClient(new HttpClientHandler());
HttpResponseMessage response = await client.PostAsync("URL", new FormUrlEncodedContent(values));
但是现在我发送请求的方法是 GET,我需要发送像 POST 这样的值来获取响应,否则它会返回错误。 任何人都可以帮助如何使用 GET 方法发送值吗? 谢谢。
【问题讨论】:
标签: c# windows-phone-8 http-get dotnet-httpclient