0
votes

The same Check In Rest API working in Sharepoint provider hosted low trust app but in High trust app it gives Error 'Not well formatted JSON stream'

    <!-- language: lang-js -->
    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,
                            method: "POST",
                            headers: { "Accept": "application/json; odata=verbose" },
                            binaryStringResponseBody: false,
                            success: function (data) { },
                            error: function (data) { fnUpdateFileFailure(data) },
                            state: "Update"
                });
1

1 Answers

0
votes

I Just change the header and it works for me !

headers: {
          "X-HTTP-Method": "PUT", 
           "accept": "application/json; odata=verbose" 
         },