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;
to a HTTP client.
I tried cat raw.http | curl
but without success.
Any suggestion?
Thx.
The Raw HTTP action sends a HTTP request to a web server. How the response is treated depends on the method, but in general the status code and the response headers are returned in variables defined as part of the page load options.
In Chrome CTRL + SHIFT + C to launch Chrome Console. From there select Network Tab; There you can see the POST Request details and form data.
Raw means that the header is not URL-encoded, whereas if the word "raw" is omitted, the header is encoded. For example: $header = 'http://www.mywebsite.com?
An HTTP request is divided into three parts: Request line, header and body. An HTTP response is also divided into three parts: Status line, header and body.
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
Manual page
Note that neither of these solutions would work if your need httpS instead of http. In this case you can send it this way:
$ cat raw.http | openssl s_client -connect server:443
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With