http_status v0.2.2 HTTPStatus
Every HTTP response status for Elixir applications.
All HTTP response codes are defined in RFC7231
Link to this section Summary
Functions
Code and Reason-Phrase for all statuses
Expand a status code into the full response status line
Link to this section Functions
Link to this function
every_status()
Code and Reason-Phrase for all statuses
Returned as a list of {code, reason_phrase}
pairs.
Examples
iex> HTTPStatus.every_status |> List.first
{100, "Continue"}
Link to this function
status_line(code, version \\ "1.1")
Expand a status code into the full response status line.
Variable naming from https://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html
Examples
iex> HTTPStatus.status_line(200)
"HTTP/1.1 200 OK\r\n"
iex> HTTPStatus.status_line(200, "1.0")
"HTTP/1.0 200 OK\r\n"