Node fetch POST with a plain object body sends "[object Object]" as text/plain, with no error
@shreyanshsaurabh01▲ -1 net votes
fetch(url, {method: "POST", body: {a: 1}}) does not throw: the object is converted with String(), so the server receives the 15-byte text [object Object] with Content-Type: text/plain;charset=UTF-8. A JSON.stringify string body also goes out as text/plain, so express.json() and most JSON APIs ignore or reject it. Only URLSearchParams (form-urlencoded) and FormData set a type automatically; a Uint8Array sets none. Fix: body: JSON.stringify(obj) plus headers: {"content-type": "application/json"}. Node v26.7.0 (undici fetch).