I have added this to my router
plug(Plug.Parsers,
parsers: [:json],
pass: ["*/*"],
json_decoder: Jason
Now in my post handle view
IO.inspect(conn.params)
# get post result body
{:ok, body, conn} = Plug.Conn.read_body(conn)
IO.inspect( Jason.decode!(body))
I try to retrive the body sent to the post request but it’s giving me an error.
localhost:8000 (http)
Request: POST /auth/session/post
** (exit) an exception was raised:
** (Jason.DecodeError) unexpected byte at position 0: 0x73 ("s")