http_status v0.1.0 HTTPStatus

Working with status codes for HTTP responses.

Defined status-lines are from https://tools.ietf.org/html/rfc7231#section-6.1

Summary

Functions

List of all statuses as tuples of {code, reason}

Expand a status code into the correct status line

Functions

every_status()

List of all statuses as tuples of {code, reason}

Examples

iex> HTTPStatus.every_status |> List.first
{100, "Continue"}
status_line(int)

Expand a status code into the correct 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"