Use: to read data from resource
Safe operation - does not change the state of the resource
If not found, INSERT
if found, UPDATE
Multiple PUTs will not change the result
Likely saving a file multiple times
Not Safe operation - DOES change the state of the resource
Use: To CREATE a new object (inset)
Multiple POSTs is expected to create multiple objects
Not Safe Operation - does change the state of the resource
Use: To delete an object (resource)
Multiple DELETEs will have the same effect/behavior
Not Safe Operator: Does change the state of the resource
What do you mean by Safe Methods?
Because they only fetch information, do not cause changes to the server
Partial modification to the specified resources
Not Safe Operator:
Action such as repetition that have no further effect on the outcome
PUT - If you found it you update it
DELETE - you can’t delete twice
Is POST Idempotent?
POST is likely to create multiple objects.
When you post a form online and if refresh, they ask you if you want to repost it again.
Or when you are checking out and are asked not to refresh the page. (To avoid sending another post)