我想传递一个原始HTTP请求,如:
GET /foo/bar HTTP/1.1
Host: example.org
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; fr; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8
Accept: */*
Accept-Language: fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded
X-Requested-With: XMLHttpRequest
Referer: http://example.org/test
Cookie: foo=bar; lorem=ipsum;
Run Code Online (Sandbox Code Playgroud)
到HTTP客户端.
我试过cat raw.http | curl但没有成功.
有什么建议吗?
谢谢.
Lek*_*eyn 27
原始数据中的原始数据:
nc example.org 80 < raw.http
Run Code Online (Sandbox Code Playgroud)
如果您需要通过某个程序管道数据:
cat raw.http | someprogram | nc example.org 80
Run Code Online (Sandbox Code Playgroud)
问题是标记卷曲所以我认为这是关于卷曲答案的时间
cat raw.http | curl "telnet://TARGETHOST:80"
Run Code Online (Sandbox Code Playgroud)
对于正常使用,只需要将TARGETHOST设置为与"host"标头值相同.
出于我的目的(不正常),我正在点击一个TARGETHOST,它是一个服务器正在侦听特定主机的主机头的IP地址.
请注意,如果您需要httpS而不是http,这些解决方案都不会起作用.在这种情况下,您可以这样发送:
$ cat raw.http | openssl s_client -connect server:443
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
16555 次 |
| 最近记录: |