-
Notifications
You must be signed in to change notification settings - Fork 340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTTPPoison.Base process_response_body with maybe gziped headers #345
Comments
I had a similar case and i'd say it's not possible. httpoison/lib/httpoison/base.ex Lines 703 to 708 in 5cfb016
which means, you have either access to We setup the Same would be true for the |
You should be able to use defmodule MyThing do
use HTTPoison.Base
alias HTTPoison.Response
def process_response(response) do
%Response{response |
body: body_processor(response.headers, response.body)
}
end
# contrived example
defp body_processor(headers, body) do
if headers, do: body, else: ""
end
end |
Is there a way one can check the headers if the message is gziped in:
defp process_response_body(body), do: body
in my case i can not assume they are always gziped so I need to check the response headers if its gziped or not but I cant figure out how to do this with HTTPPoison.Base?
The text was updated successfully, but these errors were encountered: