We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Reproduction
When using Stream and DELETE at the same time, the Body is not sent.
Here is my reproduction code and comparison code.
import { Readable } from "stream"; import fetch from "node-fetch"; function jsonReadable() { const stream = new Readable({ read() {}, }); setTimeout(() => { stream.push('{"id":6,"delete_mark":0}'); stream.push(null); }, 1000); return stream; } { const resBox = await fetch("https://httpbin.org/post", { method: "POST", body: jsonReadable(), }); const data = await resBox.json(); console.log(data); } /** { args: {}, data: '{"id":6,"delete_mark":0}', files: {}, form: {}, headers: { "Accept-Encoding": "gzip, deflate, br", Host: "httpbin.org", "Transfer-Encoding": "chunked", "User-Agent": "node-fetch", "X-Amzn-Trace-Id": "Root=1-6491434c-7e6794f35fef470f4947803b", }, json: { delete_mark: 0, id: 6 }, url: "https://httpbin.org/post", } */ { const resBox = await fetch("https://httpbin.org/delete", { method: "DELETE", body: jsonReadable(), }); const data = await resBox.json(); console.log(data); /** { args: {}, data: "", files: {}, form: {}, headers: { "Accept-Encoding": "gzip, deflate, br", Host: "httpbin.org", "User-Agent": "node-fetch", "X-Amzn-Trace-Id": "Root=1-64914334-1b83650b7523b5c96a12b485", }, json: null, url: "https://httpbin.org/delete", } */ } { const resBox = await fetch("https://httpbin.org/delete", { method: "DELETE", body: JSON.stringify({ id: 6, delete_mark: 0 }), }); const data = await resBox.json(); console.log(data); /** { args: {}, data: '{"id":6,"delete_mark":0}', files: {}, form: {}, headers: { "Accept-Encoding": "gzip, deflate, br", "Content-Length": "24", "Content-Type": "text/plain;charset=UTF-8", Host: "httpbin.org", "User-Agent": "node-fetch", "X-Amzn-Trace-Id": "Root=1-649146b6-0c217a394a1dcb4b6f10d8be", }, json: { delete_mark: 0, id: 6 }, url: "https://httpbin.org/delete", } */ }
Expected behavior
I hope that the Stream can be sent normally when using the DELETE method.
Your Environment
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Reproduction
When using Stream and DELETE at the same time, the Body is not sent.
Here is my reproduction code and comparison code.
Expected behavior
I hope that the Stream can be sent normally when using the DELETE method.
Your Environment
The text was updated successfully, but these errors were encountered: