Quantcast
Channel: Active questions tagged rest - Stack Overflow
Viewing all articles
Browse latest Browse all 3641

RESTful API Create - should it return conflict if exist, or be idempotent and return 200 if values are the same?

$
0
0

What title says - if I have an endpoint to create element, but the element already exist, what's the best / common practice? Should I:

  • Return conflict based on the fact that an object with the key already exist?
  • Or check if the existing object is the same, and if so return 200 instead (or other ok-ish status code)?

Thanks!


Viewing all articles
Browse latest Browse all 3641

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>