Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What should I return for an HTTP PUT REST call that results in no changes?

Tags:

rest

http

put

I have a resource that is created by POST, then can be updated via PUT.

If someone calls PUT and doesn't change anything, should it still return a 200 and look like the update has been performed (even though nothing was actually updated)?

like image 915
Steve Heyman Avatar asked Nov 08 '22 16:11

Steve Heyman


1 Answers

In my opinion, 200 is fine. The request was OK and was processed the way it should. There is no semantic status code expressing an operation that did not result in any changes.

like image 149
mbnx Avatar answered Nov 15 '22 05:11

mbnx