【发布时间】:2020-08-27 01:32:10
【问题描述】:
我目前可以使用curl -u "oauth2accesstoken:token-value" https://gcr.io/v2/_catalog 来获取我的注册表中的容器列表,有没有办法通过网络应用来做到这一点?
我尝试过使用fetch('https://us.gcr.io/v2/_catalog',{method:'GET', headers:header }).then(res=>console.log(res)).catch(err=>console.log(err));,但不断收到 405 CORS 错误。我做错了什么还是这不可能?
我的标题是header.set('Authorization', 'Basic ' + btoa(username + ":" + password));
【问题讨论】:
标签: reactjs curl fetch google-container-registry