resilient-http / resilient.js

Fault tolerant and reactive HTTP client for node.js and browsers
183 stars 13 forks source link

How to request binary files? #155

Open raydenx opened 5 years ago

raydenx commented 5 years ago

Can you provide an example how to request binary files? Normally, with http module I would do this:

http.get({...}, (res) => { // Use res.pipe() or res.on('data', ..) here but neither of them is working with resilient });

h2non commented 5 years ago

Resilient was not designed to operate with binary, potentially large, responses that can rely on streams. You can reply on the buffered body, if available, instead of streams. If the response is large, you should probably use a different library.