Returning the HTTP code of a HTTP request

Posted on Tue 05 February 2013 in misc • Tagged with http, curl

This is really useful for returning HTTP code of a request.

curl --write-out "%{http_code}\n" --silent --output /dev/null www.example.com


Continue reading

Tracing Redirects with curl

Posted on Thu 31 May 2012 in misc • Tagged with curl

I quite often need to debug rewrites and redirects and with curl this is quite easy.

curl -I -L "http://somewhere.com"

also you can add the -k option to ignore invalid certificate errors


Continue reading