OPTIONS stream request requires body: ''
to finish the request successfully.
const str = got.stream('https://www.jsdelivr.com', {
"method": "OPTIONS",
"body": '', // `RequestError: socket hang up` without that parameter.
});
Either RequestError: socket hang up
, or unnecessary body: ''
should be passed.
Should work fine without body: ''
since OPTIONS request doesn't have body.
const str = got.stream('https://www.jsdelivr.com', {
"method": "OPTIONS",
});
str.on('socket', () => { console.log('socket'); });
str.on('end', () => { console.log('end'); });
str.on('retry', (...args) => { console.log('retry', ...args); });
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