This project is read-only.
1
Vote

Patch request fails

description

Hi,

I'm trying to update a single property of a specific entry using PATCH OData request.
The result is always statusCode 500 with message:
"The server encountered an internal error that prevented it from fulfilling this request".

I've found examples in which odata.type is included in the sent data object, and examples in which it is not included – so I tried both options, but the result is always statusCode 500.

Any idea?

The request code looks like this:
OData.request({
requestUri: "<ServiceURI>/MyObjects(guid'00505695-007C-1ED5-9CB8-6B359297A375')",
method: "PATCH",
    data: {
            //  "odata.type" : <Service>.<ObjectType>, // I tried with and without this property
                "bPropertyToChange" : true
           },
            headers: {
                "X-Requested-With": "XMLHttpRequest",
                "Content-Type": "application/atom+xml",
                "DataServiceVersion": "2.0",
                "X-CSRF-Token": sHeaderXcsrfToken
            }
        }, function (oData, oResponse) {
        }, function (oMessage) {
      }
Thanks,

Dan

comments

oisin wrote Dec 9, 2015 at 7:54 PM

The HTTP 500 error is coming from the server. Why are you wondering about the client?