List Plug.Conn Status Code Atoms
When returning a response in a Phoenix controller, you can send the explicit status code or a semantic Atom
that represents the code:
send_resp(conn, 200, "")
# or
send_resp(conn, :ok, "")
To view a complete list of the status code atoms, open in up a mix REPL (iex -S mix
) and run:
h Plug.Conn.Status.code
Tweet