如何在外部连接SharePoint? [英] How to connect SharePoint externally?
问题描述
请指导我如何在外部连接SharePoint,
Please guide me how to connect SharePoint externally,
当我尝试从外部使用其余数据获取列表数据时,会抛出类似以下错误:
When i try to take list data using rest from externally it throw me error like:
XMLHttpRequest无法加载http://para12kspvm01/sites/P2P/_api/web/lists/getByTitle('DemoList')/items?$ select = Id,Title.所请求的资源上没有"Access-Control-Allow-Origin"标头.因此不允许来源'http://localhost:4200' 使用权.响应的HTTP状态码为401.
XMLHttpRequest cannot load http://para12kspvm01/sites/P2P/_api/web/lists/getByTitle('DemoList')/items?$select=Id,Title. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:4200' is therefore not allowed access. The response had HTTP status code 401.
谢谢
Shital Girmal
Shital Girmal
推荐答案
如果要从另一个域调用SharePoint REST API,则需要在调用REST API之前通过修改web.config为SharePoint启用跨站点脚本功能:
If you want to call SharePoint REST API from another domain, you need to enable the Cross Site scripting feature for SharePoint by modifying the web.config before call the REST API:
跨站点脚本与SharePoint 2013 REST调用:
Cross Site Scripting with SharePoint 2013 REST calls:
https://blog.kenaro.com/2014/03/18/cross-site-scripting-with-sharepoint-2013-rest-calls/
谢谢
最好的问候
这篇关于如何在外部连接SharePoint?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!