browserify / http-browserify

node's http module, but for the browser
MIT License
245 stars 110 forks source link

Return Buffer objects from requests where it makes sense #89

Open myndzi opened 9 years ago

myndzi commented 9 years ago

See: http://stackoverflow.com/questions/30869460/node-js-browserify-error-on-parsing-tar-file/30878794#30878794, https://github.com/substack/stream-browserify/issues/8

It would be nice if this module emitted actual instances of Buffer so that it is compatible with other streams, specifically for .pipe

feross commented 9 years ago

+1

jhiesey commented 9 years ago

I'm actually in the process of writing a replacement for http-browserify with much more compatible stream support. It looks like @substack hasn't had the time to maintain this module, and its behavior is quite different from the native node http module in some important ways.

I should have an initial version on github within a day or two.

tejasshah93 commented 9 years ago

+1 (Problem faced. SO question poster.)

feross commented 9 years ago

@jhiesey Returning Buffer instead of string by default, making responseType optional (and defaulting to binary), and using new streams, would all be amazing changes!

feross commented 9 years ago

Link to potential http-browserify replacement is here: https://github.com/jhiesey/httpstream (it fixes this issue)