📜  在 fetch 中捕获状态代码 403 - Javascript 代码示例

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

代码示例1
let response = await fetch(url1);
        console.log(response.status);
        if (response.status == 200) {
            let resJSON = await response.json();
            console.log(resJSON);
            let data=resJSON;
        } else {
            console.log("ERROR");
        }