Middle
Which request is idempotent?
sobes.tech AI
Answer from AI
An idempotent request is an HTTP request that can be performed multiple times in a row without changing the server's state after the first execution.
Examples of idempotent methods:
- GET — simply retrieves data without modifying it.
- PUT — updates a resource; repeated calls will have the same effect.
- DELETE — deletes a resource; repeated deletion of the same resource will not change the state.
For example, sending a PUT request to update a user's profile with the same data multiple times will leave the user's state unchanged.
Unlike POST, which is usually not idempotent, as each call can create a new resource or change the state.