HttpClient SendAsync
2021-02-08 16:20
标签:ring mes wait www new nbsp oid eth status HttpClient SendAsync 标签:ring mes wait www new nbsp oid eth status 原文地址:https://www.cnblogs.com/Fred1987/p/13071759.html static async void HttpClientSendAsync()
{
var client = new HttpClient(new HttpClientHandler { UseProxy = false });
var request = new HttpRequestMessage(HttpMethod.Post, "http://www.albahari.com/EchoPost.aspx");
request.Content = new StringContent("This is a test!");
HttpResponseMessage response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
string result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
}
上一篇:PHP 扩展开发初探
文章标题:HttpClient SendAsync
文章链接:http://soscw.com/index.php/essay/52721.html