1

我正在使用 GET 方法获取 thingsboard Restfull Http APIs 的数据,但我们无法获取数据。

Response to preflight request doesn't pass access control check:
No 'Access-Control-Allow-Origin' header is present on the requested resource. 
Origin 'http://localhost:8888' is therefore not allowed access.
The response had HTTP status code 401.

我们在 Angularjs 平台上调用 Thingsboard APIs。我们如何解决这个错误。

POST 方法一直运行良好,但我们在 thingsboard 的 GET 方法上遇到错误。

提前致谢!!

4

1 回答 1

1

您需要发出CORS请求,因为您要使用的 API 在不同的域中具有资源。

于 2018-04-20T07:09:23.110 回答