在Sharepoint提供商托管的低信任应用程序中使用相同的Check In Rest API,但在 High trust app it gives Error 'Not well formatted JSON stream' 中
var spUrl = appweburl "/_api/SP.AppContextSite(@target)/web/getfilebyserverrelativeurl('" fnGetServerRelPath(sFileRef)"')/checkin(comment='Check-In',checkintype=0)?@target='" hostweburl "'";
var executor = new SP.RequestExecutor(appweburl);
executor.executeAsync(
{
url:spUrl,
方法:"POST",
Headers :{"Accept":"application/json; odata=verbose"},
binaryStringResponseBody:false,
成功:功能(数据){},
错误:function(data){fnUpdateFileFailure(data)},
州:"Update"
});
1 回答
我只是改变 Headers ,它对我有用!
Headers :{
"X-HTTP-Method":"PUT",
"accept":"application/json; odata=verbose"
},