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

Idempotent operations (stars, reposts…) should be PUT instead of POST #320

Open
valpackett opened this issue Mar 20, 2013 · 2 comments
Open

Comments

@valpackett
Copy link
Contributor

PUT https://alpha-api.app.net/stream/0/posts/1/repost

makes much more sense than

POST https://alpha-api.app.net/stream/0/posts/1/repost

If the post is already reposted, you can't repost it more. Same with star, mute, follow. These actions are idempotent – you can't follow/star/repost/mute twice.

See We Don't Know HTTP for an in-depth explanation.

@derelk
Copy link
Contributor

derelk commented Mar 20, 2013

I suggest finding a textual and authoritative source. I think it's really unlikely that anyone is going to watch a 40-minute conference video to evaluate this issue.

@mattflaschen
Copy link
Contributor

http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.1.2

Though this seems to come up a lot (better adherence to HTTP best practices). Correct me if I'm wrong, but I haven't seen app.net actually make a change for such a reason yet. Presumably they are considering simplicity (no duplicate methods) and backwards-compatibility.

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

No branches or pull requests

3 participants