cURL / Mailing Lists / curl-users / Single Mail

curl-users

Outputting HTTP request to a file

From: RSN RSN <authorisation_at_gmail.com>
Date: Fri, 15 Apr 2005 16:50:03 +0100

Hi,

Is it possible to output the HTTP request that curl sends to the
output file as well (i.e like the "Follow TCP stream" in Ethereal)?

The -i option seems to only print the HTTP server response and not the
HTTP request.
This option would be a handy addition to an already excellent tool.

This is the script that I am trying to use.

quantity=0
while [ $quantity -le 255 ] ; do
        CHAR=`printf "%%%02X" $quantity`
        echo -e "***********************************\n\n" >> shopping.txt
curl -v -i \
        -d 'item=Rolex+Daytona' \
        -d quantity=$CHAR \
        -d 'price=%A379.99'\
        -d 'buy=BUY' \
        --url http://192.168.0.16/cgi-bin/shopping.cgi >> shopping.txt
        echo -e "***********************************\n\n" >> shopping.txt
        quantity=`expr $quantity + 1`
done
Exit
Received on 2005-04-15