Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.
Shade in the A or B circle for each question.
Draw a line connecting each item on the left to its match on the right.
| Left column | Right column | |
|---|---|---|
| 1GET /students/42 | AAsks the server for the resource that has the URL /students/42, using a standard HTTP method | |
| 2GET /orders/7 Authorization: Bearer abc123 | BA stateless request that carries everything the server needs, including the credentials, so the server remembers nothing from earlier requests | |
| 3Resources are identified by URLs, so each item of data gets its own address | CThe server relies on remembered state from an earlier request, so the request is not stateless. The request should include the page number, such as /items?page=3. | |
| 4Client-server separation: the client asks for data and the server sends it back, with neither depending on how the other works internally | Dresponse = requests.get("https://api.school.edu/students/42") | |
| 5GET /getStudent?action=fetch&id=42 | Ehttps://api.school.edu/students/42/results | |
| 6GET /next-page (server uses its memory of the last page sent) | FThe URL describes an action instead of a resource. REST should use a resource URL like /students/42 and let the HTTP method (GET) show the action. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
REST — A web API style where data is treated as resources, each with its own URL, accessed using standard HTTP requests. Each request is stateless, so the server remembers nothing between requests.url = "https://api.school.com/students/7"
response = requests.get(url)GET /students/7 HTTP/1.1
Host: api.school.comtoken = "abc123"
headers = {"Authorization": token}response = requests.get(url)
data = response.json()body = {"name": "Zoe"}
requests.post(url, json=body)