Proposal: Request.json
helper
#1791
Labels
addition/proposal
New features or enhancements
needs implementer interest
Moving the issue forward requires implementers to express interest
topic: api
What problem are you trying to solve?
Currently, we have a
Response.json(obj, init)
static method to build JSONResponse
, cf #1389However, we do not seem to have a
Request.json(url, obj, init)
equivalent to build JSONRequest
.What solutions exist today?
Setting
body
withJSON.stringify
as well as thecontent-type
header by hand :How would you solve it?
I suggest adding a
Request.json(url, obj, init)
static method mirroring theResponse.json(obj, init)
static method.Alternatively, it could be a
Request.json(url, init)
static method (the JS object then being given through init.body).Anything else?
No response
The text was updated successfully, but these errors were encountered: