Settings

Theme

Yes, a POST can be idempotent, said HTTP RFC editor

twitter.com

1 points by rmedaer 4 years ago · 4 comments

Reader

detaro 4 years ago

Not sure why that is worth highlighting, it's pretty obvious?

  • rmedaerOP 4 years ago

    Really? Reading blogs, articles, etc. 99% of them say "POST is idempotent". They never say "but it could be".

    • detaro 4 years ago

      Huh, if anything the common argument is that POST is not idempotent by default (and thus isn't cached, needs consideration on automatic retries on errors (e.g. browsers will ask you if you want to send again, proxies can't auto-repeat it), ...), and then lots of advice how to structure your APIs so it is. Because spec very clearly doesn't guarantee it to be idempotent, but you can of course implement your specific application so it uses it in an idempotent way.

    • raxxorrax 4 years ago

      I think many people argue that it should be because of network and protocol properties.

      http://home.here/setlighton > http://home.here/togglelight. If the answer gets lost and the command is repeated, you have an unknown state of the light in the second case, but both requests are perfectly valid of course.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection