Req - A batteries-included HTTP client for Elixir

I’ve noticed that Req returns iodata when the response is streamed/chunked from the server. The automatic decoding step doesn’t happen, although the content type (csv in my case txt/csv) is set appropriately. Is this expected behavior, or could this be improved?

In this particular case I’m not using Req’s body response streaming feature. Getting the full response body in one go would be ideal. I see there is an :into option for the response body, but I don’t know how to set its value to collect the response in a binary (and it still wouldn’t decode automatically).

Never mind, I totally misinterpreted something I was seeing. What I saw was not iodata, but was the decoded csv after all! Even chunked responses get decoded perfectly. Sorry for the confusion!

1 Like