詳細見
https://developer.mozilla.org/zh-CN/docs/Web/API/Fetch_API/Using_Fetch
Body
類定義了以下方法(這些方法都被 Request
和Response
所實現)以獲取 body 內容。這些方法都會返回一個被解析后的Promise
對象和數據。
fetch('http://example.com/movies.json') .then(function(response) { return response.json(); }) .then(function(myJson) { console.log(myJson); });