Re: [fetch] Automatically set request's "Content-Type" to "application/json" for POJOs (#47)

I disagree about it being too magic.  The spec already has "magic" cases for `Blob`, `FormData`, `URLSearchParams`, and `USVString`.  This would extend that to JSON, which adds symmetry with `response.json()` and paves the cowpath, since so many modern APIs expect JSON.

@annevk - is `body.constructor === Object || Array.isArray(body) || body.toJSON === function` a fair test?  That covers the common cases without adding a weird edge for Strings (which you probably don't want to stringify anyway).

---
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/47#issuecomment-99512789

Received on Wednesday, 6 May 2015 15:23:10 UTC