当前位置: 技术问答>linux和unix
一个关于http报文里的格式问题,大雪一定要进
来源: 互联网 发布时间:2015-11-26
本文导语: 我给服务端发送如下报文 GET /writfile.asp HTTP/1.0rn Host:192.168.1.182rn User-Agent: Mozila/4.0Http/1.0rn Accept: */*rn Accept-Language:enrn Content-Type:text/htmlrnContent-Length: 30rnConnection: Keep-Alivernrn username=jinqiao&password=1234rn 我需要在writ...
我给服务端发送如下报文
GET /writfile.asp HTTP/1.0rn Host:192.168.1.182rn User-Agent: Mozila/4.0Http/1.0rn Accept: */*rn Accept-Language:enrn Content-Type:text/htmlrnContent-Length: 30rnConnection: Keep-Alivernrn username=jinqiao&password=1234rn
我需要在writfile.asp中用request("username"),request("password")来获得客户端发过来得信息,但是得到得是空
GET /writfile.asp HTTP/1.0rn Host:192.168.1.182rn User-Agent: Mozila/4.0Http/1.0rn Accept: */*rn Accept-Language:enrn Content-Type:text/htmlrnContent-Length: 30rnConnection: Keep-Alivernrn username=jinqiao&password=1234rn
我需要在writfile.asp中用request("username"),request("password")来获得客户端发过来得信息,但是得到得是空
|
你可以把username和password放在URL里面会简单一些,像这样:
GET /writfile.asp?username=jinqiao&password=1234
如果一定要把数据放在最后发送,那么需要用POST方式发送,并且数据间不是用&分隔:
POST /writfile.asp HTTP/1.0rn
......
username=jinqiao
password=1234
GET /writfile.asp?username=jinqiao&password=1234
如果一定要把数据放在最后发送,那么需要用POST方式发送,并且数据间不是用&分隔:
POST /writfile.asp HTTP/1.0rn
......
username=jinqiao
password=1234