搬砖搬砖~
Content-Type:application/x-www-form-urlencoded的请求如下
var nvc = new List<KeyValuePair<string, string>>();
nvc.Add(new KeyValuePair<string, string>("account", ""));
nvc.Add(new KeyValuePair<string, string>("password", ""));
var client = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, url) { Content = new FormUrlEncodedContent(nvc) };
var res = await client.SendAsync(req);
var s=await res.Content.ReadAsStringAsync();
参考资料
How to POST using HTTPclient content type = application/x-www-form-urlencoded