Tuesday, September 21, 2010

curl to issue HTTP requests

If you install curl, a command-line client that can issue HTTP requests, you can see this directly at, e.g., www.google.com (where the --head flag prevents curl from returning the whole page):

$ curl --head www.google.com
HTTP/1.1 200 OK
.
.

$ curl --head www.google.com
HTTP/1.1 302 Found
Location: http://www.google.ca/
Cache-Control: private
Content-Type: text/html; charset=UTF-8

$ curl www.google.com
HTTP/1.1 302 Found
Location: http://www.google.ca/
Cache-Control: private
Content-Type: text/html; charset=UTF-8

$ curl www.google.com

302 Moved


The document has moved
here.

No comments: