Blog

httpstatus コマンドで、HTTP のステータスコードをすばやくしらべる!

一般的な Web Programmer ならば、HTTP Status code はすべて暗記していると聞きました。

しかし、僕は初心者なので、なかなか覚えきれていないので、HTTPのステータスコードをさがすのに便利なツールを用意しました。App::httpstatus です。インストール方法は cpanm App::httpstatus です。というか依存とかないのでhttp://api.metacpan.org/source/TOKUHIROM/App-httpstatus-v1.0.0/httpstatus をコピーしてくればうごきます。

使い方は以下のとおりです。

4xx なコードを列挙する。

% httpstatus 4
400 Bad Request
401 Unauthorized
402 Payment Required
403 Forbidden
404 Not Found
405 Method Not Allowed
406 Not Acceptable
407 Proxy Authentication Required
408 Request Timeout
409 Conflict
410 Gone
411 Length Required
412 Precondition Failed
413 Request Entity Too Large
414 Request-URI Too Large
415 Unsupported Media Type
416 Request Range Not Satisfiable
417 Expectation Failed
418 I'm a teapot
422 Unprocessable Entity
423 Locked
424 Failed Dependency
425 No code
426 Upgrade Required
428 Precondition Required
429 Too Many Requests
431 Request Header Fields Too Large
449 Retry with

40x なコードを列挙する

% httpstatus 40
400 Bad Request
401 Unauthorized
402 Payment Required
403 Forbidden
404 Not Found
405 Method Not Allowed
406 Not Acceptable
407 Proxy Authentication Required
408 Request Timeout
409 Conflict

500 ってなんだっけ?

% httpstatus 500
Internal Server Error

403 ってなんだっけ?

% httpstatus 403
Forbidden

Bad なんとかってなんだっけ?

% httpstatus Bad
400 Bad Request
502 Bad Gateway

とりあえず全部みるか。

% httpstatus