-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Question: pipe stream to POST request #3
Comments
It should look like: var pipe = fs
.createReadStream(fileName)
.pipe(
- request({ url: url, method: 'POST'}));
+ retryRequest({ url: url, method: 'POST'}));
pipe
.on('error', function(err) {
console.error(err);
})
.on('response', function (answer) {
})
.on('complete', function (answer) {
})
.on('end', function(answer) {
}); Can you let me know if that works? |
No this does not work, all look OK but result seem to be empty stream. |
Sorry, I don't know how I missed the Using |
Left a note in the readme that points here. |
I can see why stream POST is an issue, I ended up add the retry logic in an upper level. |
Sorry, it's a bit irrelevant. @stephenplusplus, how did you achieve the red and green lines to show the changes in your comment? |
No problem @ruffle1986. I thought it was pretty cool the first time I saw it, too.
⏬ var pipe = fs
.createReadStream(fileName)
.pipe(
- request({ url: url, method: 'POST'}));
+ retryRequest({ url: url, method: 'POST'})); |
I have similar issue even with GET but work as expected with request Using pump returns a empty response
Using pipe gives a "write after end" error
|
@surya1024 thank you for reporting. Would you mind opening a new issue for that? |
Have this code which work fine with request, what will be the correct way to call it in retry-request?
The text was updated successfully, but these errors were encountered: