Showing posts with label HTTPステータスコード. Show all posts
Showing posts with label HTTPステータスコード. Show all posts

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

Friday, September 28, 2018

cURL: Getting HTTP Status Codes from the Command Line

Command:

$ curl -I https://ja.wikipedia.org/wiki/天賞


Result:

HTTP/1.1 404 Not Found
Date: Fri, 28 Sep 2018 08:14:21 GMT
Content-Type: text/html; charset=UTF-8
...