response.rawBody <Buffer ...>
On error, got.stream response is not pipable. The response body is under response.rawBody
which is supposed to be "only accessible when using Promise API" (https://github.com/sindresorhus/got/blob/main/documentation/3-streams.md#rawbody). I would assume there's no data
event as the response body has already been consumed?
on data <Buffer ...>
const got = require('got')
const url = 'https://run.mocky.io/v3/99fc1661-4a34-4334-a123-ae9c02b33db4'
got.stream(url)
.on('error', error => {
const { response } = error
console.log('response.rawBody', response.rawBody)
})
.on('data', chunk => {
console.log('on data', chunk)
})
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too