i develop res service at which it take unique id parameter each call, but when the same id used more than once it should retrieve the same response was retrieved the first time and status code specify error, i am looking for the best status code for that , some post use "409 Conflict
" and some "406 Not Acceptable
", which to use ?
409 is better, because 406 is mostly used to represent header not acceptable.
406 Not Acceptable The requested resource is capable of generating only content not acceptable according to the Accept headers sent in the request.
409 (Conflict) means your request is duplicated.
409 Conflict Indicates that the request could not be processed because of conflict in the request, such as an edit conflict between multiple simultaneous updates.