首页 > 解决方案 > 如何使用 ssl 客户端身份验证 fetch()?

问题描述

fetch 按如下方式发送:

    fetch(url)
        .then(response => {
            if(!response.ok){
                throw Error("Http request failed");
            }else{
                return response
            }
        })
        .then(response => response.text())
        .then(validate => validate.replace(/\D/g,''))
        .then(count => {
            chrome.action.setBadgeText({text: count});
            if(callback){
                callback();
            }
        })
        .catch(error => {
            console.log(error)
            if(callback){
                callback();
            }
        });

如果您能指导我解决可能的问题,我将不胜感激。

标签: javascriptauthenticationgoogle-chrome-extensionfetchssl-client-authentication

解决方案


推荐阅读