Getting net::ERR_INSECURE_RESPONSE when calling url using fetch api

六眼飞鱼酱① 提交于 2019-12-24 23:26:37

问题


I'm using fetch API to call a URL which has some SSL settings and after calling it I straight away have to login in order to access the contents and I get this error while calling it

net::ERR_INSECURE_RESPONSE

my code is

  let header = new Headers({
  'Access-Control-Allow-Origin':'',
  'Content-Type': 'multipart/form-data'
  });
let username="***";
let password="***";
let url ="***";
let sentData={
    method:'POST',
    mode: 'cors',
    header: header
};
return new Promise((reslove,reject)=>{
    fetch(url, sentData)
        .then(response=> response.json())
        .then(responseText=>{

            console.log(responseText);

        }).catch(err=>{
        console.log(err);
    });
}).catch(err => {
        console.log(err);
    });

Sorry I can't share the URL, username and password. How do I solve this?

来源:https://stackoverflow.com/questions/49504887/getting-neterr-insecure-response-when-calling-url-using-fetch-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!