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);
        }

 

相关文章:

  • 2021-12-23
  • 2021-10-09
  • 2022-01-31
  • 2021-06-04
猜你喜欢
  • 2022-12-23
  • 2022-02-03
  • 2021-12-10
  • 2022-12-23
  • 2022-12-23
  • 2022-01-18
相关资源
相似解决方案