Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support 409 conflict for post requests #107

Closed
ordnungswidrig opened this issue Mar 7, 2014 · 8 comments
Closed

Support 409 conflict for post requests #107

ordnungswidrig opened this issue Mar 7, 2014 · 8 comments
Milestone

Comments

@ordnungswidrig
Copy link
Member

While RFC2626 suggests only PUT requests to return 409, this can also be useful for POST requests.

See https://groups.google.com/forum/#!topic/clojure-liberator/RmR1RzIxBh0

@ordnungswidrig ordnungswidrig added this to the 1.0 milestone Mar 7, 2014
@aperiodic
Copy link

+1. We use POSTs to update resources, but sometimes the edits don't make sense, so it would be useful to return a 409 after executing post!.

@ordnungswidrig
Copy link
Member Author

If the edits don't make sense, then 422 unprocessable entity might be a better choice.

@rlinehan
Copy link

+1. I've got basically the exact same problem as in this post: https://groups.google.com/forum/#!msg/clojure-liberator/iaxFQPMZqJs/bMETIFMLHwwJ - the email address in our user table must be unique, and a 409 should be returned for a POST to create a user with an email address that already exists in the table.

@ttasterisco
Copy link

+1, similar use case as @rlinehan's

1 similar comment
@vitillo
Copy link

vitillo commented Aug 30, 2014

+1, similar use case as @rlinehan's

@conan
Copy link

conan commented Sep 4, 2014

+1, also similar to @rlinehan's

@sethkrasnianski
Copy link
Contributor

+1

@ordnungswidrig
Copy link
Member Author

I'm open for a PR. I suggest to support conflict for POST to move the decision "conflict?" be before "post-to-existing?" (see the graph for reference: http://clojure-liberator.github.io/liberator/assets/img/decision-graph.svg). After that change conflict? will be called for POST and PUT requests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants