fetch到的<ReadableStream>rep

2018-12-12  本文已影响15人  TOPro

const response = await fetch("remote_url");

const text = await response.text();
//or
const json = await response.json();

以上两个方法用于或者文本/JSON两种情况

上一篇 下一篇

猜你喜欢

热点阅读