Updating OSLC resources

You can use the HTTP PUT method to replace an OSLC resource and the HTTP POST with a PATCH override to partially update an OSLC resource.

An HTTP PUT completely replaces the data in the resource with the properties in the request.

An HTTP POST with an x-method-override of PATCH replaces a local resource property with the content in the request.

An HTTP POST with an x-method-override of PATCH and a PATCHTYPE of MERGE finds and matches the local resource elements from the request with the elements on the server. Depending on whether a match was found, the local resource elements are updated or inserted. A local element is never deleted from the local resource property.

When you send an update request, you can include the transaction ID in the HTTP request header. The transaction ID must be unique across all client applications. OSLC saves the transaction ID status in the database when the request is completed. If you submit a request with a transaction ID, OSLC checks whether the transaction exists in the database. If the transaction does exist, OSLC does not run the request. It returns an error that indicates that the request was not completed because the transaction ID exists. The following is an example header with the transaction ID specified:
Accept: application/rdf-xml
transactionid: 6001
Content-Type: application/json;charset=utf-8