二、fetch中的基础语法
参考:https://developer.mozilla.org/zh-CN/docs/Web/API/Fetch_API/Using_Fetch fetch概念 fetch不是Ajax,它诞生的目的是为了代替Ajax,它是js中内置的API。 基于fetch可以实现客户端和服务端的信息通信 由于fetch是2018年提出,因此存在浏览器兼容问题。 fetch('https://v1.hitokoto.cn', { method: 'GET', }).then(result => { console.log(result); }) fetch('https://v1.hitokoto.cn', { method: 'POST', body: 'c=b', headers: { 'Content-Type': 'x-www-form-urlcoded' }, ...





