我调用这个接口,为啥出现这种错误?

来源:3-3 Koa 中间件与洋葱模型

edgar_programmer

2021-05-14

Access to fetch at ‘http://api.github.com/users’ from origin ‘http://localhost:3000’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. If an opaque response serves your needs, set the request’s mode to ‘no-cors’ to fetch the resource with CORS disabled.

写回答

1回答

lewis

2021-05-14

跨域了,别在浏览器里调用

0
0

Node.js仿知乎服务端-深入理解RESTful API

Koa2+MongoDB+Postman+JWT+阿里云

952 学习 · 331 问题

查看课程