4 ms·
These comments seem at odds: > GET and HEAD should not change any state > (be safe and idempotent) > But of course it changes something, as > 0 * x is
by pyre 16y ago
These comments seem at odds:
> GET and HEAD should not change any state
> (be safe and idempotent)
> But of course it changes something, as
> 0 * x is clearly not x in the general case.
If 0 * x is idempotent, but it changes things then how can 'should not change state' be equivalent to idempotent? If I use a GET request to submit a shopping cart (for example), as long as submitting that URL a second time doesn't placee a second order for a copy of the original shopping cart (maybe it has a unique identifier so the backend can tell that it's already been submitted), then that should be idempotent, right?
- bobfunk 16y agoUsing GET to submit a shopping cart can be "idempotent", but it is not "safe" since it changes state on the server. GET should always be both safe and idempotent.
- wahnfrieden 16y agoRight, but the idempotence is a side effect of the safety here. It's not the main point.