Skip to content

Support req.end with callback only#1547

Merged
paulmelnikow merged 1 commit intonock:betafrom
gugu:beta
May 9, 2019
Merged

Support req.end with callback only#1547
paulmelnikow merged 1 commit intonock:betafrom
gugu:beta

Conversation

@gugu
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

gugu commented May 9, 2019

@paulmelnikow done

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.
```
juninmd pushed a commit to juninmd/nock that referenced this pull request Mar 21, 2026
According to the docs, `req.end` can accept callback as a first argument. That's what `got` module does.

Closes 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.
```
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.

3 participants