How to send an HTTPS GET Request in C#

后端 未结 3 1062
暗喜
暗喜 2020-12-12 21:40

Related: how-do-i-use-webrequest-to-access-an-ssl-encrypted-site-using-https

How to send an HTTPS GET Request in C#?

3条回答
  •  半阙折子戏
    2020-12-12 22:40

    Simple Get Request using HttpClient Class

    using System.Net.Http;
    
    class Program
    {
       static void Main(string[] args)
        {
            HttpClient httpClient = new HttpClient();
            var result = httpClient.GetAsync("https://www.google.com").Result;
        }
    
    }
    

提交回复
热议问题