问题
I am working on fetch data of thingsboard Restfull Http Apis using GET method, but we are not able to get fetch data.
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.
We are calling Thingsboard Apis on Angularjs platform. How we can Solve this error.
POST Method has been working fine, but we are getting error on GET method of thingsboard.
Thanks in Advance!!
回答1:
You will need to make a CORS request, because the API you want to use, has resources on a different domain.
来源:https://stackoverflow.com/questions/49935854/thingsboard-no-access-control-allow-origin-header-is-present-on-the-requested