HTTP.StatusText (http_fetch v0.11.0)

View Source

HTTP status code to status text mapping.

Provides standard status text messages for HTTP status codes following the Browser Fetch API specification and RFC standards.

Examples

iex> HTTP.StatusText.get(200)
"OK"

iex> HTTP.StatusText.get(404)
"Not Found"

iex> HTTP.StatusText.get(500)
"Internal Server Error"

iex> HTTP.StatusText.get(999)
""

Summary

Functions

Returns the status text for a given HTTP status code.

Functions

get(status_code)

@spec get(integer()) :: String.t()

Returns the status text for a given HTTP status code.

Returns empty string for unknown status codes.

Examples

iex> HTTP.StatusText.get(200)
"OK"

iex> HTTP.StatusText.get(404)
"Not Found"

iex> HTTP.StatusText.get(999)
""