"fetch() request with GET/HEAD/OPTIONS method cannot have body" in Bun
dimonnwc3 opened this issue · comments
Dmitrii commented
Following code throws an error:
const res = await ky.post(baseURL("/api/v1/countries"), {
json: { email: "aaaaaaa", name: "a" },
})
TypeError: fetch() request with GET/HEAD/OPTIONS method cannot have body.
code: "ERR_INVALID_ARG_VALUE"
❯ bun --version
1.0.2
"ky": "^1.0.1",
Sindre Sorhus commented
I recommend opening an issue on Bun. We have a test to prove it works fine in Node.js:
Lines 62 to 66 in 98d76e6
Dmitrii commented
resolved with this: oven-sh/bun#6144