Recall & Review
beginner
What is a REST API request?
A REST API request is a message sent by a client to a server to ask for data or to perform an action, usually using HTTP methods like GET, POST, PUT, or DELETE.
Click to reveal answer
beginner
What does a typical REST API response contain?
A typical REST API response contains a status code (like 200 for success), headers, and a body with data usually formatted in JSON.
Click to reveal answer
beginner
Example of a GET request to fetch user data
GET /users/123 HTTP/1.1
Host: api.example.com
Accept: application/json
Click to reveal answer
beginner
Example of a JSON response for a user fetch request
{
"id": 123,
"name": "Alice",
"email": "alice@example.com"
}
Click to reveal answer
beginner
What HTTP status code means 'Resource not found'?
The HTTP status code 404 means 'Resource not found'. It tells the client that the requested data does not exist on the server.
Click to reveal answer
Which HTTP method is used to retrieve data from a REST API?
✗ Incorrect
GET is used to request data from a server without changing it.
What does a 200 HTTP status code indicate?
✗ Incorrect
200 means the request was successful and the server returned the requested data.
Which content type is most commonly used in REST API responses?
✗ Incorrect
JSON (application/json) is the most common format for REST API responses.
What HTTP method is used to create a new resource?
✗ Incorrect
POST is used to send data to the server to create a new resource.
What does a 404 status code mean in a REST API response?
✗ Incorrect
404 means the requested resource does not exist on the server.
Explain the structure of a typical REST API request and response.
Think about what the client sends and what the server replies.
You got /7 concepts.
Describe how you would use a REST API to get user information and handle the response.
Imagine you want to see a friend's profile on a website.
You got /6 concepts.