Today I Learned

hashrocket A Hashrocket project

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
See More #elixir TILs
Looking for help? At Hashrocket, we 💜 Elixir! From our many Elixir client projects, to sponsoring the Chicago Elixir Meetup, to the source code for this application, we are invested in this community. Contact us today to talk about your Elixir project.