News for hackers. Stuff that matters.
Re:Request bodies in GET requests by nine_k on Monday January 31, 2022 @06:28PM (#30156328)
GETs are idempotent and pure, at least in theory. Any replica can serve them, give an identical result, and change no data.

POST, on the other hand, is expected to mutate data. It needs to go to the master node, unless you have bidirectional replication, which is way more complex.

This is why a load balancer / proxy can spread GET requests and cache their results, but can't do so with POSTs.

QUERY is like POST in that it has a body, but is like GET in that it's idempotent, and should return the same result given the same URL and body. Load-balancing and caching work again.

Re:Request bodies in GET requests by dragonwriter on Monday January 31, 2022 @06:52PM (#30156601)
> GETs are idempotent and pure, at least in theory.

No, gets are safe (do not induce any client-responsibility state changes) and idempotent (do not induce any additional client-responsibility change of state for a second identical request with no intervening action after the first), not pure (do not depend on any state outside of the request).

Re:Request bodies in GET requests by pvg on Monday January 31, 2022 @06:43PM (#30156499)
GETs are not pure, not even in theory. If they were, you could cache the result of any GET request forever.