Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Dec 232010
 

Show HTTP response using curl command

Answer:

curl is a very powerful tool for transferring data from or to a server, which support many protocols such as HTTP, HTTPS, FTP etc.

Example: Issue a HTTP request to a remote server.

# curl -v http://www.example.com

* About to connect() to www.example.com port 80 (#0)
*   Trying 192.0.32.10... connected
* Connected to www.example.com (192.0.32.10) port 80 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.19.5 (x86_64-pc-linux-gnu) libcurl/7.19.5 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.15
> Host: www.example.com
> Accept: */*
>
< HTTP/1.1 200 OK
< Server: Apache
< Last-Modified: Fri, 30 Jul 2010 15:30:18 GMT
< ETag: "573c1-254-48c9c87349680"
< Accept-Ranges: bytes
< Content-Type: text/html; charset=UTF-8
< Connection: Keep-Alive
< Date: Wed, 22 Dec 2010 16:19:06 GMT
< Age: 817
< Content-Length: 596
...

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>