0

what should be the status code for updating an entity with same values

ex if i have an entity employee in my database with attributes employee_id=123,employee_name='xyz',gender='male'

*what should be the Status code for Update request fired with the same values * i am confused between 304 not modified or 409 conflict whichi one would be helpful

Mahi Tej Gvp
  • 984
  • 1
  • 14
  • 34

1 Answers1

0

I think one of the success code would be appropriate (200, 204).

as you can see, 304 has caching in mind. You don't cache in your case.

The server generating a 304 response MUST generate any of the following header fields that would have been sent in a 200 OK response to the same request: Cache-Control, Content-Location, Date, ETag, Expires, and Vary.

Also 409 means error, if the value is updated to what you wanted(although there is no change) it would be better to view it as success case.

Clojurevangelist
  • 564
  • 1
  • 8
  • 13