4 ms·
Yes, that's why you use POST for everything with effects. But if this is really your concern, you should also be using PUT to create new database records. In p
by thaumasiotes 3y ago
Yes, that's why you use POST for everything with effects.
But if this is really your concern, you should also be using PUT to create new database records. In principle, those requests are safer to repeat than updates are, since the database will ignore repeated inserts and apply repeated updates. (Though as far as I can tell this only matters if your update adjusts a value rather than setting it outright.)
- The_Colonel 3y ago> Yes, that's why you use POST for everything with effects. I don't get it. Isn't an idempotent effect still an effect? > you should also be using PUT to create new database records. If the client is free to define the identity, then I do. But if the resource gets e.g. an ID from Postgres sequence, then I need to use POST, because repeated call would create duplicates.