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
Set response encoding #20
Comments
Would you mind sharing a Plunker with an example of your code? |
This is a stripped down version of my code, in coffeescript axios = require 'axios'
Zip = require 'adm-zip'
downloadSubitles = () ->
axios
url: 'http://subscene.com/subtitle/download?mac=PEuUfx42AOa6Sju0WvWBFlbLF_YeiqKwsB62_ws6DQH1khKyJy1_sj0-df29vIFw0'
.then (response) ->
buffer = new Buffer(response.data, 'binary')
zip = new Zip(buffer)
srt = zip.readAsText zip.getEntries()[0] |
There is a |
That would be good! |
I've been looking a bit into this, so I think maybe we could support |
@nickdima sorry I've totally neglected your issue. Yes, please submit a PR. |
Looking forward to this. My use case is websites that don't properly specify encoding in headers, but do specify it in a meta tag. So I need to parse as utf-8 first, and then possibly re-parse as different content type. |
Sorry guys, I haven't use axios lately so I wont be able to work on that PR at this point. Maybe someone else could give it a try. |
I believe that this has been solved. See current http implementation https://github.com/mzabriskie/axios/blob/master/lib/adapters/http.js#L93-L96 |
I wanted to get a buffer out of some binary data from a GET request but I couldn't get it to work unless I put
res.setEncoding('binary')
insidehttp.js
Any suggestions?
The text was updated successfully, but these errors were encountered: