-
-
Notifications
You must be signed in to change notification settings - Fork 956
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Socket hang up error when using the delete method with stream API #2303
Comments
You need to pass |
Oh wow. @sindresorhus Thank you so much for the quick response. That worked. Could you explain why I need to set the body to empty string explicitly if it's a delete method, please? I thought delete methods don't have body (usually). |
I'm honestly not sure. I didn't add that part. Probably some weird behavior with Node.js streams. Maybe @szmarczak remembers. |
I would assume if we don't pass a body, the library would set it to an empty string (if it's required). @szmarczak do you know why we need to do that instead? Thanks a lot in advance. |
Describe the bug
When using the stream API, all methods work correctly, but when using the delete method, we get a
socket hang up
error every time. I am not sure what is so specific about the delete method, but this happens only when using it. I tried to change the agent and the response type; I even tested this on my friends' machines, and I can reproduce it on any machine.Actual behavior
Using the delete method with the stream API ends up with a
socket hang up
error consistently.Expected behavior
Using the delete method with the stream API should be able to connect to the provided resource and return a response.
Code to reproduce
Checklist
The text was updated successfully, but these errors were encountered: