我们可以使用RESTAPI更新sharepoint中的文档吗?

iqxoj9l9  于 2021-08-20  发布在  Java
关注(0)|答案(0)|浏览(261)

我正在使用以下代码更新现有文档。但是,文档中的数据将被新内容覆盖。这是api的行为方式吗?

String url = restServiceURL.toString() + "/GetFileByServerRelativeUrl('"SharedDocuments/empty.txt "')/$value";
        HttpPost httppost = new HttpPost(url);
        httppost.addHeader("Accept", "application/json; odata=verbose");
        httppost.addHeader("content-type", "application/json; odata=verbose");
        httppost.addHeader("X-RequestDigest", getRequestDigest());
        httppost.addHeader("X-HTTP-Method", "PUT");
        HttpEntity entity = new ByteArrayEntity(binary);
        httppost.setEntity(entity);
        HttpResponse response = executePost(httppost);
        String statusLine = response.getStatusLine().toString()

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题