fetch('/users.html') .then(function(response) { return response.text() }).then(function(body) { document.body.innerHTML = body }) fetch('/users.json').then(function(response) { console.log(response.headers.get('Content-Type')) console.log(response.headers.get('Date')) console.log(response.status) console.log(response.statusText) })上面是官方文檔給的例子response.text()得到的是什么?.text()方法是在哪里定義的?fetch('/users.json') .then(function(response) { return response.json() }).then(function(json) { console.log('parsed json', json) }).catch(function(ex) { console.log('parsing failed', ex) })response.json()得到的是什么?.json()方法是在哪里定義的?
whatwg-fetch中fetch得到的response調(diào)用的.json()得到的數(shù)據(jù)類型是什么?
慕妹3146593
2018-09-19 05:47:20