cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the updated entity response in Update operation in Odata v2 at SAP endpoint ?

0 Kudos

When we perform the Insert operation at SAP endpoint , we get the created entity as a response body and get 201 Created as a response code.

But when we perform the Update or Delete operation at SAP endpoint , we didn't get any response body and get 204 No Content as a response code.

is there a way to get the response body for Update / Delete call at SAP endpoint as well?

Accepted Solutions (0)

Answers (1)

Answers (1)

CarlosRoggan
Product and Topic Expert
Product and Topic Expert

Hi,
this is implemented that way according to the specification and the return status code indicates that it has been successful operation with no response content
It assumes that you have the data, because you're aware of the entity that you're changing.
If you need the whole content (again), the only thing you can do is to perform (another) call to the entity to READ the content (same URL)
In case of DELETE, the entity is deleted - so you would have to READ it first (in common UI scenarions that would be the usual case)

If you can change to OData version 4, there you have an option (prefer-header) which you can send along with your UPDATE operation to get the data back
Cheers,
Carlos