Skip to content

Instantly share code, notes, and snippets.

@Gab-km
Forked from anonymous/HttpStatus.fs
Last active December 14, 2015 00:59
Show Gist options
  • Select an option

  • Save Gab-km/5003050 to your computer and use it in GitHub Desktop.

Select an option

Save Gab-km/5003050 to your computer and use it in GitHub Desktop.

Revisions

  1. Gab-km revised this gist Feb 21, 2013. 1 changed file with 1 addition and 4 deletions.
    5 changes: 1 addition & 4 deletions httpStatus.rst
    Original file line number Diff line number Diff line change
    @@ -4,17 +4,14 @@

    HttpStatus.fs です。インストール方法は 適当にコンパイルしてください。

    ** See also **

    **See also**

    `httpstatus コマンドで、HTTP のステータスコードをすばやくしらべる! - tokuhirom's blog.
    <http://blog.64p.org/entry/2013/02/21/121830>`_


    `Big Sky :: httpstatus コマンドで、HTTP のステータスコードをすばやくしらべる!
    <http://mattn.kaoriya.net/software/vim/20130221123856.htm>`_


    `httpstatus コマンドで、HTTP のステータスコードをすばやくしらべる! - ( ꒪⌓꒪) ゆるよろ日記
    <http://yuroyoro.hatenablog.com/entry/2013/02/21/144004>`_

  2. Gab-km revised this gist Feb 21, 2013. 1 changed file with 10 additions and 4 deletions.
    14 changes: 10 additions & 4 deletions httpStatus.rst
    Original file line number Diff line number Diff line change
    @@ -6,11 +6,17 @@ HttpStatus.fs です。インストール方法は 適当にコンパイルし

    ** See also **

    * `httpstatus コマンドで、HTTP のステータスコードをすばやくしらべる! - tokuhirom's blog.

    `httpstatus コマンドで、HTTP のステータスコードをすばやくしらべる! - tokuhirom's blog.
    <http://blog.64p.org/entry/2013/02/21/121830>`_
    * `Big Sky :: httpstatus コマンドで、HTTP のステータスコードをすばやくしらべる!


    `Big Sky :: httpstatus コマンドで、HTTP のステータスコードをすばやくしらべる!
    <http://mattn.kaoriya.net/software/vim/20130221123856.htm>`_
    * `httpstatus コマンドで、HTTP のステータスコードをすばやくしらべる! - ( ꒪⌓꒪) ゆるよろ日記


    `httpstatus コマンドで、HTTP のステータスコードをすばやくしらべる! - ( ꒪⌓꒪) ゆるよろ日記
    <http://yuroyoro.hatenablog.com/entry/2013/02/21/144004>`_
    * `httpstatusコマンドで、HTTPのステータスコードをすばやくしらべる! - YAMAGUCHI::weblog

    `httpstatusコマンドで、HTTPのステータスコードをすばやくしらべる! - YAMAGUCHI::weblog
    <http://ymotongpoo.hatenablog.com/entry/2013/02/21/160646>`_
  3. Gab-km revised this gist Feb 21, 2013. 1 changed file with 12 additions and 1 deletion.
    13 changes: 12 additions & 1 deletion httpStatus.rst
    Original file line number Diff line number Diff line change
    @@ -2,4 +2,15 @@

    しかし、僕は初心者なので、なかなか覚えきれていないので、HTTPのステータスコードをさがすのに便利なツールを用意しました。

    HttpStatus.fs です。インストール方法は 適当にコンパイルしてください。
    HttpStatus.fs です。インストール方法は 適当にコンパイルしてください。

    ** See also **

    * `httpstatus コマンドで、HTTP のステータスコードをすばやくしらべる! - tokuhirom's blog.
    <http://blog.64p.org/entry/2013/02/21/121830>`_
    * `Big Sky :: httpstatus コマンドで、HTTP のステータスコードをすばやくしらべる!
    <http://mattn.kaoriya.net/software/vim/20130221123856.htm>`_
    * `httpstatus コマンドで、HTTP のステータスコードをすばやくしらべる! - ( ꒪⌓꒪) ゆるよろ日記
    <http://yuroyoro.hatenablog.com/entry/2013/02/21/144004>`_
    * `httpstatusコマンドで、HTTPのステータスコードをすばやくしらべる! - YAMAGUCHI::weblog
    <http://ymotongpoo.hatenablog.com/entry/2013/02/21/160646>`_
  4. Gab-km revised this gist Feb 21, 2013. 1 changed file with 1 addition and 5 deletions.
    6 changes: 1 addition & 5 deletions httpStatus.rst
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,5 @@
    httpstatus コマンドで、HTTP のステータスコードをすばやくしらべる!
    -----------------------------------------------------------------

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

    しかし、僕は初心者なので、なかなか覚えきれていないので、HTTPのステータスコードをさがすのに便利なツールを用意しました。

    HttpStatus.fs です。インストール方法は 適当にコンパイルしてください。

    HttpStatus.fs です。インストール方法は 適当にコンパイルしてください。
  5. Gab-km revised this gist Feb 21, 2013. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions httpStatus.rst
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,6 @@
    httpstatus コマンドで、HTTP のステータスコードをすばやくしらべる!
    -----------------------------------------------------------------

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

    しかし、僕は初心者なので、なかなか覚えきれていないので、HTTPのステータスコードをさがすのに便利なツールを用意しました。
  6. @invalid-email-address Anonymous created this gist Feb 21, 2013.
    85 changes: 85 additions & 0 deletions HttpStatus.fs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,85 @@
    type HttpStatus =
    { Code: string; Message: string }
    override self.ToString () = sprintf "%s %s" self.Code self.Message

    let httpStatus code message = { Code = code; Message = message }

    let httpStatusList =[
    httpStatus "100" "Continue";
    httpStatus "101" "Switching Protocols";
    httpStatus "102" "Processing";
    httpStatus "200" "OK";
    httpStatus "201" "Created";
    httpStatus "202" "Accepted";
    httpStatus "203" "Non-Authoritative Information";
    httpStatus "204" "No Content";
    httpStatus "205" "Reset Content";
    httpStatus "206" "Partial Content";
    httpStatus "207" "Multi-Status";
    httpStatus "208" "Already Reported";
    httpStatus "300" "Multiple Choices";
    httpStatus "301" "Moved Permanently";
    httpStatus "302" "Found";
    httpStatus "303" "See Other";
    httpStatus "304" "Not Modified";
    httpStatus "305" "Use Proxy";
    httpStatus "307" "Temporary Redirect";
    httpStatus "400" "Bad Request";
    httpStatus "401" "Unauthorized";
    httpStatus "402" "Payment Required";
    httpStatus "403" "Forbidden";
    httpStatus "404" "Not Found";
    httpStatus "405" "Method Not Allowed";
    httpStatus "406" "Not Acceptable";
    httpStatus "407" "Proxy Authentication Required";
    httpStatus "408" "Request Timeout";
    httpStatus "409" "Conflict";
    httpStatus "410" "Gone";
    httpStatus "411" "Length Required";
    httpStatus "412" "Precondition Failed";
    httpStatus "413" "Request Entity Too Large";
    httpStatus "414" "Request-URI Too Large";
    httpStatus "415" "Unsupported Media Type";
    httpStatus "416" "Request Range Not Satisfiable";
    httpStatus "417" "Expectation Failed";
    httpStatus "418" "I'm a teapot";
    httpStatus "422" "Unprocessable Entity";
    httpStatus "423" "Locked";
    httpStatus "424" "Failed Dependency";
    httpStatus "425" "No code";
    httpStatus "426" "Upgrade Required";
    httpStatus "428" "Precondition Required";
    httpStatus "429" "Too Many Requests";
    httpStatus "431" "Request Header Fields Too Large";
    httpStatus "449" "Retry with";
    httpStatus "500" "Internal Server Error";
    httpStatus "501" "Not Implemented";
    httpStatus "502" "Bad Gateway";
    httpStatus "503" "Service Unavailable";
    httpStatus "504" "Gateway Timeout";
    httpStatus "505" "HTTP Version Not Supported";
    httpStatus "506" "Variant Also Negotiates";
    httpStatus "507" "Insufficient Storage";
    httpStatus "509" "Bandwidth Limit Exceeded";
    httpStatus "510" "Not Extended";
    httpStatus "511" "Network Authentication Required"
    ]

    let showStatus key =
    match List.tryFind (fun hs -> hs.Code = key) httpStatusList with
    | Some hs -> hs.ToString() |> printfn "%s"
    | _ ->
    let toStringAll xs = List.map (fun x -> x.ToString()) xs
    match List.filter (fun hs -> hs.Code.Contains key) httpStatusList with
    | [] ->
    match List.filter (fun hs -> hs.Message.Contains key) httpStatusList with
    | [] -> toStringAll httpStatusList
    | hss -> toStringAll hss
    | hss -> toStringAll hss
    |> List.iter (printfn "%s")

    [<EntryPoint>]
    let main args =
    if args.Length <> 1 then showStatus ""
    else showStatus args.[0]
    0
    6 changes: 6 additions & 0 deletions httpStatus.rst
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    一般的な Web Programmer ならば、HTTP Status code はすべて暗記していると聞きました。

    しかし、僕は初心者なので、なかなか覚えきれていないので、HTTPのステータスコードをさがすのに便利なツールを用意しました。

    HttpStatus.fs です。インストール方法は 適当にコンパイルしてください。