从SharePoint 2013/2016调用外部REST API时出错 [英] Error while calling external REST API from SharePoint 2013/2016

查看:95
本文介绍了从SharePoint 2013/2016调用外部REST API时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hi Team,


我正在尝试使用ajax从SharePoint 2013/2016调用外部/第三方REST API,但收到以下错误。 


来自'http:// sharepointsite'的'http://api.####.com/rest/v1/company?key = ######'访问XMLHttpRequest已经被CORS策略阻止:对预检请求的响应未通过访问控制检查:请求资源上没有'Access-Control-Allow-Origin'标头是


我在谷歌搜索中尝试了几个设置,但还没有运气。


如何解决?任何人都可以在这个问题上帮助我吗?


如果有任何我需要做的话,任何人都可以给我设置会很棒。


问候。

解决方案



基本上你需要启用CORS来接受请求。我不确定到目前为止你试图解决的问题是什么,如果你能在这里列出它们会很棒。  Chrome有此设置,允许访问。


请阅读以下主题并告知我们。


https://community.powerbi。 com / t5 / Developer / Error-No-Access-Control-Allow-Origin-header-is-present-on-td-p / 350280


现在让我来吧


Hi Team,

I am trying to call external/3rd party REST api from SharePoint 2013/2016 using ajax but getting below error. 

Access to XMLHttpRequest at 'http://api.####.com/rest/v1/company?key=######' from origin 'http://sharepointsite' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

I have tried couple of settings found in google search but no luck yet.

How to fix it? Can anyone please help me in this issue?

It would be great if anyone can give me the settings if there is any which i need to do.

Regards.

解决方案

Hi,

Basically you need enable CORS to accept the request. I am not sure what and all you tried to fix this so far , it will be great if you could list them here.  Chrome has this setting where it can allow access .

Please read the below thread and let me know.

https://community.powerbi.com/t5/Developer/Error-No-Access-Control-Allow-Origin-header-is-present-on-the/td-p/350280

Let me now 


这篇关于从SharePoint 2013/2016调用外部REST API时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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