如何发送C#中的HTTPS GET请求 [英] How to send an HTTPS GET Request in C#
本文介绍了如何发送C#中的HTTPS GET请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
相关阅读:<一href="http://stackoverflow.com/questions/560804/how-do-i-use-webrequest-to-access-an-ssl-encrypted-site-using-https">how-do-i-use-webrequest-to-access-an-ssl-encrypted-site-using-https
如何在C#中发送一个HTTPS GET请求?
How to send an HTTPS GET Request in C#?
推荐答案
添加 VAR1 =数据1&放大器; VAR2 =数据2
到URL的末尾值提交到页通过GET:
Add ?var1=data1&var2=data2
to the end of url to submit values to the page via GET:
using System.Net;
string url = "https://www.example.com/scriptname.php?var1=hello";
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Stream resStream = response.GetResponseStream();
这篇关于如何发送C#中的HTTPS GET请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文