private void OpenPost()//同步
{
using (HttpClient client = new HttpClient())
{
client.DefaultRequestHeaders.Add("name","zhuzili");
var response = client.PostAsync("http://www.baidu.com",null).Result;
var str = response.Content.ReadAsStringAsync().Result;
MessageBox.Show(str);
}
}
转载于:https://www.cnblogs.com/zzzili/p/6685244.html