HTTP GET 请求内容 ,怎么发送呢?
1) dyndns, statdns
GET /dyndns/update?system=statdns&hostname=yourhost.ourdomain.ext
&myip=ipaddress&wildcard=OFF&mx=mail.exchanger.ext&backmx=NO
&offline=NO HTTP/1.1
Host: members.3322.org
Authorization: Basic username:pass
(note: username:pass must be encoded in base64)
User-Agent: myclient/1.0 [email protected]
1) dyndns, statdns
GET /dyndns/update?system=statdns&hostname=yourhost.ourdomain.ext
&myip=ipaddress&wildcard=OFF&mx=mail.exchanger.ext&backmx=NO
&offline=NO HTTP/1.1
Host: members.3322.org
Authorization: Basic username:pass
(note: username:pass must be encoded in base64)
User-Agent: myclient/1.0 [email protected]
要发送GET 请求的参数,则必须将这些额外的信息附在URL本身的后面。
System.Net.WebClient clinet = new System.Net.WebClient();
//打开URL,GET参数以URL后缀的方式就可以传递过去。
System.IO.Stream stream=clinet.OpenRead("url?param=value1");
//把从HTTP中返回的流读为string
System.IO.StreamReader reader = new System.IO.StreamReader(stream);
string result = reader.ReadToEnd();
System.Net.WebClient wb = new System.Net.WebClient();
wb.DownloadData("http://www.aa.com/bb.aspx?a=1&b=2");如果是post可以用UploadValues方法