抱歉,我正在使用 Phonenix Framwork / Elixir,我需要在 PUT 方法中使用带有大 json 的 HTTPoison,但总是发送响应错误,我能做什么?
这是mi功能码
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