如何与response.json
一起使用此“ reviver”?例如:fetch(url)
.then(a => a.json({reviver})) // unfortunately not working
.then(...)
fetch(url) .then(a => a.text()) .then(b => new Promise((resolve) => resolve(JSON.parse(b, reviver)))) .then()
但是它又使用了一步,这似乎没有用。还有更好的主意吗?
[JSON.parse附带了一个“ reviver”函数(例如:“ JSON.parse using reviver function”)。如何在response.json中使用此“ reviver”?例如:fetch(url).then(a => a.json({...