5 ms·
OTOH, "removing information from the URL for aesthetic reasons" may not be the best reason to move a safe operation from GET, which is defined as safe, to POST,
by stcredzero 12y ago
OTOH, "removing information from the URL for aesthetic reasons" may not be the best reason to move a safe operation from GET, which is defined as safe, to POST, which is neither safe nor idempotent, particularly if you are using middleware that is aware of HTTP semantics -- you've just thrown away valuable information.
So a part of the point of and value of GET is to communicate idempotency? We can know certain parts of the API are idempotent because they are GET?
- dragonwriter 12y agoPUT and DELETE are idempotent, GET is safe (and idempotent, but safety necessarily includes idempotency, since "no side effects on resource state" also means that duplicate requests have no effects on resource state beyond that of a single request.) But, yes, a key thing communicated by HTTP method used in a call is whether the call can be relied on to be safe, idempotent, or neither.
- ForHackernews 12y ago> So a part of the point of and value of GET is to communicate idempotency? We can know certain parts of the API are idempotent because they are GET? Yes: http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html
- dragonwriter 12y agoPedantically, RFC 2616 is obsolete, and you should point to http://tools.ietf.org/html/rfc7231#section-4.1 http://tools.ietf.org/html/rfc7231#section-4.1
- arafalov 12y agoThe proxy will rely on distinction between GET and POST to know whether to cache. More importantly, your enterprise Load Balancer with timeout and failover configured will feel free to repeat a GET request internally to a different server when the first server takes too long to respond. For a POST, it will instead throw an error to a user and perhaps trigger internal alert. And if you think that's not a big deal, wait until your bank does a double international money transfer because their trigger call was implemented accidentally as a GET request and the network latency was bad. And hope, just hope, that they are not running 10 different servers behind the firewall and therefore falling over 10-1 times.... (true horror story from my tech support days).