Why are these fetch methods asynchronous?

后端 未结 4 1891
轮回少年
轮回少年 2021-01-18 05:46

Fetch is the new Promise-based API for making network requests:

fetch(\'https://www.everythingisawesome.com/\')
  .then(response => console.log(\'status:          


        
4条回答
  •  无人共我
    2021-01-18 06:38

    Because the content is not transferred until you start reading it. The headers come first.

提交回复
热议问题