-
Notifications
You must be signed in to change notification settings - Fork 200
Avoid redirection #3
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
Comments
Hmm? Redirection is fine as far as I know. |
|
I don't think I agree with him. :-) |
@gracenotes any comments? |
I think this was originally intended as a RESTful HTTP purist idea. If you created something, return 201, for instance, or maybe 204 for deletion. One of the pragmatic reasons for violating this is that post/redirect/get helps prevent duplicate form submission in web browsers, and it can make for a not-slick user experience. |
Ah sorry @gracenotes, I didn't read the full text :-) Yes, using a normal 201/204 response with a body rather than a redirect is indeed reasonable and RESTful. It's not a bad UI necessarily, since it gives you confirmation that something did happen, and the response can link through to the new resource or whatever. I was just reading the title "avoid redirection" and assumed that meant in general. Are there many places where we are using redirection rather than a response body for PUT/DELETE? |
If there is, I don't really remember. Should make a pass-through. This was listed as a general style TODO, and it probably should be in a style guide for writing features. |
There seems to be some in the PackageCandidates feature (there are FIXMEs there). |
Update aeson, tagsoup, optparse-applicative
DELETE, PUT, and (in some cases) POST should not redirect, but rather return a document indicating the location of the new resource, if necessary, or other cues to continue browsing.
The text was updated successfully, but these errors were encountered: