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
Labels
Milestone

Comments

@ordnungswidrig
Copy link
Member

@ordnungswidrig ordnungswidrig commented Mar 7, 2014

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

@aperiodic aperiodic commented Mar 10, 2014

+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

@ordnungswidrig ordnungswidrig commented Mar 11, 2014

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

@rlinehan
Copy link

@rlinehan rlinehan commented Mar 11, 2014

+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

@ttasterisco ttasterisco commented May 9, 2014

+1, similar use case as @rlinehan's

1 similar comment
@vitillo
Copy link

@vitillo vitillo commented Aug 30, 2014

+1, similar use case as @rlinehan's

@conan
Copy link

@conan conan commented Sep 4, 2014

+1, also similar to @rlinehan's

@sethkrasnianski
Copy link
Contributor

@sethkrasnianski sethkrasnianski commented May 20, 2015

+1

@ordnungswidrig
Copy link
Member Author

@ordnungswidrig ordnungswidrig commented May 21, 2015

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
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
7 participants
You can’t perform that action at this time.