Microsoft Graph SDK for SharePoint

时间:2017-12-13 03:49:06

标签: microsoft-graph

我正在寻找使用Microsoft Graph SDK将文件上传到SharePoint的方法。目前我找不到任何例子。

有没有人曾尝试使用SDK将文件上传到SharePoint?非常感谢。

2 个答案:

答案 0 :(得分:1)

我想我已经找到了。好极了!赞美上帝!

https://github.com/microsoftgraph/msgraph-sdk-dotnet/issues/208

答案 1 :(得分:1)

通常,SDK调用模式的结构镜像REST API。该路径由表示Graph API中资源的对象构建,然后组成请求(通过显式调用' request'),并指定动词(" getAsync",&# 34; addAsync"," updateAsync")。

例如GET ~/sites/<site id>/drives之类似graphClient.Sites[<site id>].Drives.Request().GetAsync();

要创建资源,首先要实例化资源并设置任何属性。

ListItem myListItem = new ListItem();

然后构建请求并将动词指定为addAsync

ListItem responseItem = await graphClient.Sites[<site id>].Lists[<list id>].Items.Request().addAsync(myListItem);