how use big json data with HTTPoison?

325 Views Asked by At

Sorry, I am using Phonenix Framwork / Elixir, I need use HTTPoison with a large json in PUT method, but always send a response error, What i can do ?

This is mi function code

def download(json, conn) do
 HTTPoison.start()
    "url"
    |> HTTPoison.post(json, [{"Content-Type", "application/json"}], recv_timeout: 800_000)
    |> case do
      {:ok, response} -> result = response.body
      {:ok, result}
      conn
      |> put_resp_content_type("application/pdf")
      |> put_resp_header("content-disposition", "attachment; filename=LB.pdf")
      |> Plug.Conn.send_resp(:ok, result)
    end
end
0

There are 0 best solutions below