-
-
Notifications
You must be signed in to change notification settings - Fork 413
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
Need a way to return 201 Created as the result of a PUT #189
Comments
Closing this as a duplicate of #190 . For people who might come across is, currently the suggested way about it is defining your own combinator, with a |
I tried to backtrack to the actual solution but couldn't really find anything. Can you go into more detail about this "own combinator" approach? Thanks! |
@i-am-the-slime Hi! This PR changed all existing HTTP method combinators to be simple type synonyms of |
Ah, I'm using stack. I'll probably wait for the next LTS including this then and just return a 200 in any case. |
You can use packages from git repos with stack as well, FWIW: http://docs.haskellstack.org/en/stable/yaml_configuration/ (scroll down a bit and look for "git") |
eg: resolver: lts-5.5
# Local packages, usually specified by relative directory name
packages:
- .
- location:
git: git@github.com:haskell-servant/servant.git
commit: 5188e842a9288ac3986b30b93cb1a5d58cb2933d
extra-dep: true
subdirs:
- servant
- servant-blaze
- servant-cassava
- servant-client
- servant-docs
- servant-examples
- servant-foreign
- servant-js
- servant-lucid
- servant-mock
- servant-server |
I don't see how hardcoding a response code into the type signature addresses the issue, which quotes the RFC as saying either a 201 or 204 should be returned, depending on if the update target already exists. |
Per RFC7321:
At the moment 200
OK
(or 204No Content
) is always returned. It would be nice to have a way to indicate that a resource was created.The text was updated successfully, but these errors were encountered: