thingsboard.github.io icon indicating copy to clipboard operation
thingsboard.github.io copied to clipboard

No 'Access-Control-Allow-Origin' in HTTP GET method

Open Nitinkarande opened this issue 6 years ago • 2 comments

Getting error on HTTP REST Apis.

  • [x] Feature Request

We are fetching data from REST APIS using GET method. We getting error as No 'Access-Control-Allow-Origin'

We want to get thingsboard data from REST APis, but http GET method is not working and we are not able to send headers, but http PUT and POST method has been working fine

The error in details as :

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.

How we can achive and solve error. I have try to using lot of siltiuon also checked CORS on chrome browser.

Nitinkarande avatar Jun 02 '18 12:06 Nitinkarande

i just found the solution by adding new api/plugin/** (same as api/v1/**) into cors section in thingsboard.yml.

Update: you dont need to build just restart your thingsboard

zarzaid avatar Jan 28 '19 08:01 zarzaid

I am following @zarzaid comment ,but not able to save thingsbaord.yml

"thingsboard.yml"
"thingsboard.yml" E212: Can't open file for writing

can you please help

SuneethaYamani avatar Jul 15 '20 07:07 SuneethaYamani