📜  vanilla js 发送获取请求 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:21.879000             🧑  作者: Mango

代码示例2
fetch('https://jsonplaceholder.typicode.com/posts').then(function (response) {
    // The API call was successful!
    console.log('success!', response);
}).catch(function (err) {
    // There was an error
    console.warn('Something went wrong.', err);
});