What is the right HTTP code to return when POSTing a resource (e.g. a Context Susbcriber) to the REST API but it already exists?
According to the RESTful best practices I could find, it is suggested to return 409 (Conflict). But 409 seems also oriented to PUT conflicts in version-tracked resources. Others suggest using 422 (Unprocessable entity), and some popular implementations resort to simply saying 200 (OK), thus making POST kinda-idempotent, but enabling clients to be more carefree.
Currently (4.3.2-S) our REST API returns 409, but I have already seen some clients struggle with this (of course it can be fixed by just ignoring 409 when POSTing).
What is the right HTTP code to return when POSTing a resource (e.g. a Context Susbcriber) to the REST API but it already exists?
According to the RESTful best practices I could find, it is suggested to return 409 (Conflict). But 409 seems also oriented to PUT conflicts in version-tracked resources. Others suggest using 422 (Unprocessable entity), and some popular implementations resort to simply saying 200 (OK), thus making POST kinda-idempotent, but enabling clients to be more carefree.
Currently (4.3.2-S) our REST API returns 409, but I have already seen some clients struggle with this (of course it can be fixed by just ignoring 409 when POSTing).
What do you think?