Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> This means that if a POST request fails, an intermediate (such as a proxy) cannot just assume they can make the same request again.

If this is actually true for your API, then yes, there's poor API design involved, but it has nothing to do with using the POST method.

If there are really business rules that say some resource can't be created twice (for some definition of resource uniqueness), then the API should enforce that with a 403 that explains sensibly "duplicate entity" or some such error message. [1]

[1] http://tools.ietf.org/html/rfc7231#section-6.5.3



I think the response code you are looking for is HTTP 409 (Conflict) [1]

[1]: http://tools.ietf.org/html/rfc7231#section-6.5.8




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: