1,get方式

             string URI = "url";
            //实例化
            WebClient client = new WebClient();
           // client.UseDefaultCredentials = true;
            return Encoding.UTF8.GetString(client.DownloadData(URI));

2,post方式

             string URI = "url";
            string myParameters = "key=" + key + "&system_;
            //实例化
            WebClient client = new WebClient();
          //  client.UseDefaultCredentials = true;
            client.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded";
            client.Encoding = Encoding.UTF8;
            return client.UploadString(URI, myParameters);

相关文章:

  • 2022-12-23
  • 2021-12-21
  • 2021-09-05
  • 2021-11-23
  • 2021-10-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-02-20
  • 2022-02-06
  • 2021-09-25
  • 2021-11-06
  • 2022-01-10
相关资源
相似解决方案