我正在尝试通过反应应用程序中的rest API获取SharePoint List数据。
输出不是JSON 但是我得到的某种XML作为你可以参考附带的截图。
在屏幕截图中(记事本++),我已经粘贴了网络标签中的回复。
任何人都可以在这方面帮助我,或者你可以为我提供从获取数据(JSON格式)的代码。在React应用程序中的sharepoint列表。
谢谢,
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数据
发布评论