处理原始HTTP请求 [英] Process raw HTTP request
本文介绍了处理原始HTTP请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想传递一个原始HTTP请求,例如:
I'd like to pass a raw HTTP request like:
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;
到HTTP客户端。
I试过 cat raw.http |卷曲
但没有成功。
有任何建议吗?
Thx。
推荐答案
原始数据输入,原始数据输出:
Raw data in, raw data out:
nc example.org 80 < raw.http
如果需要通过某些程序通过管道传输数据:
If you need to pipe the data through some program:
cat raw.http | someprogram | nc example.org 80
这篇关于处理原始HTTP请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文