Sobes.tech
Senior

Which HTTP methods are idempotent?

sobes.tech AI

Answer from AI

Idempotent HTTP methods are methods that, when called multiple times with the same parameters, do not change the server's state beyond the initial request.

The main idempotent methods include:

  • GET — retrieve a resource, does not change state.
  • PUT — update or create a resource at the specified URI, repeated requests result in the same outcome.
  • DELETE — delete a resource, repeated requests delete the resource if it already exists, and the state remains unchanged.
  • HEAD — similar to GET but without the response body, and is idempotent.
  • OPTIONS — request available methods, does not change state.

The POST method is not idempotent, as repeated requests can create multiple resources or trigger different actions.

Which HTTP methods are idempotent? — QA / QA Automation - sobes.tech