Wednesday, July 24, 2019

linux - How to see HTTP request header by curl?


I can see HTTP header response by curl -I command.


Is there any option to see the HTTP request header sent?


curl -I www.google.com
HTTP/1.1 200 OK
Date: Sat, 31 Dec 2011 00:55:53 GMT
Expires: -1
Cache-Control: private, max-age=0
Content-Type: text/html; charset=ISO-8859-1
Server: gws
Transfer-Encoding: chunked

Answer



From the curl man page:


   -v/--verbose
Makes the fetching more verbose/talkative. Mostly useful for debugging. A line starting
with '>' means "header data" sent by curl, '<' means "header data" received by curl that
is hidden in normal cases, and a line starting with '*' means additional info provided
by curl.

No comments:

Post a Comment

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...