Skip to content
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

Merged
merged 1 commit into from May 9, 2019
Merged

Support req.end with callback only #1547

merged 1 commit into from May 9, 2019

Conversation

gugu
Copy link
Contributor

@gugu gugu commented May 8, 2019

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])

Copy link
Member

@paulmelnikow paulmelnikow left a 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.
```
@gugu
Copy link
Contributor Author

gugu commented May 9, 2019

@paulmelnikow done

Copy link
Member

@paulmelnikow paulmelnikow left a 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!

@paulmelnikow paulmelnikow merged commit 9a494da into nock:beta May 9, 2019
@nockbot
Copy link
Collaborator

nockbot commented May 9, 2019

🎉 This PR is included in version 11.0.0-beta.13 🎉

The release is available on:

Your semantic-release bot 📦🚀

@nockbot
Copy link
Collaborator

nockbot commented Aug 12, 2019

🎉 This PR is included in version 11.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

gr2m pushed a commit that referenced this pull request Sep 4, 2019
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.
```
gr2m pushed a commit that referenced this pull request Sep 4, 2019
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.
```
gr2m pushed a commit that referenced this pull request Sep 5, 2019
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.
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants