Saturday, September 29, 2018

cURL: Getting Only HTTP Status Code Number

Command:

$ curl -s -o /dev/null -w "%{http_code}" https://en.wikipedia.org/wiki/Ichiro_Suzuki

Result:

200


Command:

$ curl -s -o /dev/null -w "%{http_code}" https://en.wikipedia.org/wiki/Ichiro_Suzuk

Result:

404