以json格式获取Sharepoint List数据 [英] Fetching Sharepoint List data in json format
问题描述
我正在尝试通过反应应用程序中的rest API获取SharePoint List数据。
输出不是JSON 但是我得到的某种XML作为 你可以参考附带的截图。
在屏幕截图中(记事本++),我已经粘贴了网络标签中的回复。
任何人都可以在这方面帮助我,或者你可以为我提供从 获取数据(JSON格式)的代码。在React应用程序中的sharepoint列表。
< p style ="color:#212121; font-size:11pt; font-family:Calibri,sans-serif; margin-bottom:0px">
谢谢,
Balaram
尝试以下格式。
fetch(`rest endpoint`,{
accept:'application / json; odata = verbose',
})
。然后
最诚挚的问候,
Lee
Hi,
I am trying to fetch SharePoint List data through a rest API in my react application.
The output is not JSON but some kind of XML I am getting as you can refer the attached screenshot.
In the screenshot(notepad++), I ve pasted the response from Network tab.
Anyone can help me in this regard or can u plz provide me the code to fetch the data(JSON format) from the sharepoint List in React application.
Thanks,
Balaram
Hi,
Try below format.
fetch(`rest endpoint`, { accept: 'application/json;odata=verbose', }) .thenBest Regards,
Lee
这篇关于以json格式获取Sharepoint List数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!