Closed DanCurryy closed 2 years ago
When attempting DELETE request without a body option, got hangs before timing out.
Provided a minimal recreation below where it fails to enter any event handler when options.body is not set to some value.
Does not enter any event handler.
Expect to see the logging for res and end at the very least, but neither are ever called.
res
end
const options = { url: 'https://httpbin.org/delete', method: 'DELETE' } const makeRequest = async (options) => { const { default: got } = await import('got') const ourRequestStream = got.stream(options) ourRequestStream .on('response', (response) => { console.log('res') }) .on('data', (response) => { console.log('data') }) .on('end', (response) => { console.log('end') }) .on('error', (e) => { console.log('error') }) } makeRequest(options)
Body is not required on DELETE. See https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/DELETE
Can you provide a repro with native Node.js server?
Describe the bug
When attempting DELETE request without a body option, got hangs before timing out.
Provided a minimal recreation below where it fails to enter any event handler when options.body is not set to some value.
Actual behavior
Does not enter any event handler.
Expected behavior
Expect to see the logging for
res
andend
at the very least, but neither are ever called.Code to reproduce
Checklist