事情板上请求的资源上没有'Access-Control-Allow-Origin'标头. angularjs [英] Thingsboard No 'Access-Control-Allow-Origin' header is present on the requested resource. angularjs

查看:165
本文介绍了事情板上请求的资源上没有'Access-Control-Allow-Origin'标头. angularjs的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用GET方法获取事物板Restfull Http Apis的数据,但是我们无法获取数据.

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.

我们正在Angularjs平台上调用Thingsboard Apis.我们如何解决这个错误.

We are calling Thingsboard Apis on Angularjs platform. How we can Solve this error.

POST方法运行正常,但是在东西板上的GET方法上出现错误.

先谢谢了!

推荐答案

您需要制作一个

You will need to make a CORS request, because the API you want to use, has resources on a different domain.

这篇关于事情板上请求的资源上没有'Access-Control-Allow-Origin'标头. angularjs的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆