Skip to content

Commit

Permalink
Mention to end the stream if there's no body
Browse files Browse the repository at this point in the history
Fixes #1309
  • Loading branch information
szmarczak committed Jul 4, 2020
1 parent e1afe82 commit 044767e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ const pipeline = promisify(stream.pipeline);

**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).

**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 [`body`](#body) option to an empty string.

### API

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

0 comments on commit 044767e

Please sign in to comment.