8000 Mention to end the stream if there's no body · sindresorhus/got@044767e · GitHub
[go: up one dir, main page]

Skip to content

Commit 044767e

Browse files
committed
Mention to end the stream if there's no body
Fixes #1309
1 parent e1afe82 commit 044767e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

readme.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ const pipeline = promisify(stream.pipeline);
120120

121121
**Tip:** `from.pipe(to)` doesn't forward errors. Instead, use [`stream.pipeline(from, ..., to, callback)`](https://nodejs.org/api/stream.html#stream_stream_pipeline_streams_callback).
122122

123+
**Note:** While `got.post('https://example.com')` resolves, `got.stream.post('https://example.com')` will hang indefinitely until a body is provided. If there's no body on purpose, remember to `.end()` the stream or set the 4E57 [`body`](#body) option to an empty string.
124+
123125
### API
124126

125127
It's a `GET` request by default, but can be changed by using different methods or via [`options.method`](#method).

0 commit comments

Comments
 (0)
0