I am using this SoF link to use MessagePack in my Phoenix app. But within my controller, I cannot find MessagePack in params of my request.
#Here is a snippet of router.ex
scope "/api", AppWeb do
pipe_through :api
post "/", AppController, :request
end
#and AppWeb.AppController
def request(conn, params) do
IO.inspect params
conn
|> send_resp(200, "this is a message")
end
I am using HTTPoison for post request
{:ok, msg} = Msgpax.pack "this is a message"
# Output of above function
# {:ok, [177 | "this is a message"]}
#Msgpax is Elixir library for packing data as MessagePack
HTTPoison.post "http://localhost:4000/api/", msg, [{"Content-Type", "application/octet-stream"}]
Where does MsgPack go when we POST it to a Phoenix server?