-
Notifications
You must be signed in to change notification settings - Fork 170
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
Correct use of Unirest.pipe #14
Comments
This is a little tricky, pipe won't work on .end() does the whole shebang and instead I would rather return a request instance the whole way along instead. True aliasing. |
It does actually work and save the file though... Presumably this is a matter of "might work sometimes, but not supported" as it were, then? |
Ah, it will work because it is returned: https://github.com/Mashape/unirest-nodejs/blob/master/index.js#L489 However, it's not as pure as |
So... a-ok correct usage of Pipe for writing files? :) |
File manipulation is easier using request directly right now in my opinion. |
The Unirest API is much nicer, though ;) |
Alright, closing this then :) |
Thanks for the help, and thanks most of all for unirest-nodejs - this library is making my job a whole lot easier and nicer! :D |
Hi, it's me again!
Quick question for you - I noticed that Unirest.pipe is defined as an alias to Unirest.request.pipe:
https://github.com/Mashape/unirest-nodejs/blob/master/index.js#L703
Unirest.pipe = Unirest.request.pipe;
This does not appear to documented in the readme.
I'm trying to download images using Unirest and have stumbled across a method that seems to work:
Is this how Unirest.pipe is intended to be used, chained after .end(), or am I doing it wrong?
Thanks.
The text was updated successfully, but these errors were encountered: