-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Description
From time to time i see ppl using data instead of body which is wrong.
happened just recently in #481 (comment)
how do you feel about adding a little warning message that can only appear once. (kinda like node reports that you are using experimental apis)
if ('data' in bodyInit && notWarned) {
console.warn('use body instead')
}
class Response {
get data () {
notWarned && console.warn('you want to use .json(), .text(), .arrayBuffer() or just .body')
}
}I don't think it is uncommon to see those mistake happening when switching from different request libraries axios use data instead of body for example. I can admit that i have used data as well and wasted minutes trying to figure out what's wrong
Reactions are currently unavailable