-
-
Notifications
You must be signed in to change notification settings - Fork 733
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
Support req.end with callback only #1547
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, thanks so much for this!
Could you add a test for the case that's being fixed? I wrote some notes about it here: #1509 (comment)
According to docs, `req.end` can accept callback as a first argument. That's what `got` module does. Fixes nock#1509 ``` request.end([data[, encoding]][, callback])# History data <string> | <Buffer> encoding <string> callback <Function> Returns: <this> Finishes sending the request. If any parts of the body are unsent, it will flush them to the stream. If the request is chunked, this will send the terminating '0\r\n\r\n'. If data is specified, it is equivalent to calling request.write(data, encoding) followed by request.end(callback). If callback is specified, it will be called when the request stream is finished. ```
@paulmelnikow done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙌🏅
Thank you so much! It's great to have this fixed!
🎉 This PR is included in version 11.0.0-beta.13 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 11.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
According to the docs, `req.end` can accept callback as a first argument. That's what `got` module does. Closes #1509 ``` request.end([data[, encoding]][, callback])# History data <string> | <Buffer> encoding <string> callback <Function> Returns: <this> Finishes sending the request. If any parts of the body are unsent, it will flush them to the stream. If the request is chunked, this will send the terminating '0\r\n\r\n'. If data is specified, it is equivalent to calling request.write(data, encoding) followed by request.end(callback). If callback is specified, it will be called when the request stream is finished. ```
According to the docs, `req.end` can accept callback as a first argument. That's what `got` module does. Closes #1509 ``` request.end([data[, encoding]][, callback])# History data <string> | <Buffer> encoding <string> callback <Function> Returns: <this> Finishes sending the request. If any parts of the body are unsent, it will flush them to the stream. If the request is chunked, this will send the terminating '0\r\n\r\n'. If data is specified, it is equivalent to calling request.write(data, encoding) followed by request.end(callback). If callback is specified, it will be called when the request stream is finished. ```
According to the docs, `req.end` can accept callback as a first argument. That's what `got` module does. Closes #1509 ``` request.end([data[, encoding]][, callback])# History data <string> | <Buffer> encoding <string> callback <Function> Returns: <this> Finishes sending the request. If any parts of the body are unsent, it will flush them to the stream. If the request is chunked, this will send the terminating '0\r\n\r\n'. If data is specified, it is equivalent to calling request.write(data, encoding) followed by request.end(callback). If callback is specified, it will be called when the request stream is finished. ```
According to the docs,
req.end
can accept callback as a first argument. That's whatgot
module does.Closes #1509