cURL / Mailing Lists / curl-users / Single Mail

curl-users

RE: "Re: Outputting HTTP request to a file"

From: Roth, Kevin P. <kproth_at_mapllc.com>
Date: Tue, 19 Apr 2005 17:14:20 -0400

Why not add a "--stderr -" flag to the curl command? That'll redirect
the request and response headers given by -v to stdout (ending up in
shopping.txt). You can then remove the "-i" which is somewhat redundant.

Only problem is, the results aren't formatted exactly like you're
looking for, and you end up with the extra info (e.g. "About to
connect", "trying ip.ip.ip.ip...", "connected") at the top, and the
response headers are prefixed with "< ".

Having said that, in light of the drawbacks of this approach as
described above, I too would love to see curl's -i option changed to
include the request headers (in addition to the response headers). I've
mentioned this desire before on this list, way back. Sure, it would
change existing behavior, but it would actually be a better match for
the help text, which says:

  -i/--include Include protocol headers in the output (H/F)

That doesn't say include only response headers, does it???

- Kevin

________________________________
From: RSN
Sent: Tuesday, April 19, 2005 4:08 PM

I am trying to format the CURL output like the "Follow TCP stream"
option in Ethereal.

[snip]

What is required in penetration testing is to capture the complete
request and reply as above to the same file:

1. HTTP request sent
2. HTTP reply received
3. The raw data

[snip]

curl -v -i \
        -d 'item=Rolex+Daytona' \
        -d quantity=$CHAR \
        -d 'price=%A379.99'\
        -d 'buy=BUY' \
        --url http://192.168.0.7/cgi-bin/shopping.pl >> shopping.txt
Received on 2005-04-19