Recall & Review
beginner
What are safe methods in REST APIs?
Safe methods are HTTP methods that do not change the server's state. They are used only to retrieve data without causing side effects. Examples include GET and HEAD.
Click to reveal answer
beginner
Give examples of unsafe methods in REST APIs.
Unsafe methods are HTTP methods that can change the server's state or data. Examples include POST, PUT, DELETE, and PATCH.
Click to reveal answer
intermediate
Why are safe methods considered 'safe'?
Because they do not modify data on the server, so calling them multiple times has no side effects. They are read-only.
Click to reveal answer
intermediate
What does it mean for a method to be idempotent?
An idempotent method means that making the same request multiple times results in the same server state as making it once. Examples: GET, PUT, DELETE.
Click to reveal answer
beginner
Is POST a safe or unsafe method? Why?
POST is an unsafe method because it usually creates or modifies data on the server, changing its state.
Click to reveal answer
Which HTTP method is considered safe?
✗ Incorrect
GET is a safe method because it only retrieves data without changing server state.
Which method is NOT idempotent?
✗ Incorrect
POST is not idempotent because multiple identical POST requests can create multiple resources.
What does an unsafe method do?
✗ Incorrect
Unsafe methods modify server data or state.
Which method is both safe and idempotent?
✗ Incorrect
GET is safe and idempotent because it only reads data and does not change server state.
Which HTTP method is typically used to delete a resource?
✗ Incorrect
DELETE is used to remove resources and is an unsafe method.
Explain the difference between safe and unsafe HTTP methods in REST APIs.
Think about whether the method changes data or just reads it.
You got /4 concepts.
Describe what idempotency means for HTTP methods and give examples.
Consider what happens if you repeat the same request many times.
You got /3 concepts.