Idempotent operations (stars, reposts…) should be PUT instead of POST
valpackett opened this issue · comments
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.
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.
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.