相关疑难解决方法(0)

react-native fetch返回奇数响应

我正在使用fetch从这样的API中获取一些东西:

fetch('http://facebook.github.io/react-native/movies.json')
        .then(
            data => console.log(data),
            error => console.log(error)
        )
Run Code Online (Sandbox Code Playgroud)

但我得到的是以下对象,而不是实际数据

_bodyBlob: Blob
_bodyInit: Blob
headers: Headers
ok: true
status: 200
statusText: undefined
type: "default"
url: "http://facebook.github.io/react-native/movies.json"
Run Code Online (Sandbox Code Playgroud)

有人可以解释我哪里错了?我做错了什么?

javascript fetch react-native

5
推荐指数
1
解决办法
1538
查看次数

标签 统计

fetch ×1

javascript ×1

react-native ×1