What you will learn
GET asks for data. HEAD asks for the headers without a body. OPTIONS asks how the server can be contacted. PUT on the collection URL is a different request from PUT on one user.
Your goals
- Send GET, HEAD, OPTIONS and a method the collection does not allow.
- Record the status and body you actually received.
Before you start
Read the previous lesson first if you have not already. This course does not require programming.
Practice setup
These requests use the public TestKru teaching API. No workspace is needed unless a step says so. Leave the body empty for GET, HEAD and OPTIONS. Example people and emails are fictional. Changes to /api/users are simulated and are not saved.
Follow these steps
- Send GET https://testkru.com/api/users with an empty body. Select that response and notice whether the body is a list.
- Send the same URL with method HEAD and an empty body. Select that response. Compare the status with GET and look at whether the body is empty.
- Send the same URL with method OPTIONS and an empty body. Open the response headers and look for a header named Allow.
- Send PUT https://testkru.com/api/users. This is the collection URL, not /api/users/1. Select that response and read the status.
- Copy the four statuses. Choose whether the Allow header was present, then Submit Answers.
Investigate before concluding
First record the actual result for each case. Compare the body, headers and later state with the stated contract. Keep an observation separate from a prediction; use the model answer only after making your own attempt.
What to keep as evidence
- Each method is sent separately.
- HEAD is not given an invented body.
- 405 is read as a method result, not as a missing user.
References for this lesson
Finish this assignment
Select each named response with Use this response. Answer from those responses or the transcript on this page. Click Submit Answers. Your score is the percentage of checks that passed. Core checks are required to finish. Extra evidence checks are labelled. A saved 100/100 means every check passed. Continue opens the next lesson you can submit.
If something goes wrong
- Change one part of the request at a time. If a check needs attention, read the note under it and compare it with the response you selected.
Self-review and independent variation
- Each method is sent separately.
- HEAD is not given an invented body.
- 405 is read as a method result, not as a missing user.
Later, compare PUT /api/users with PUT /api/users/1 and write down which URL the 405 belongs to.
Automatic checks verify the requests and answers configured for this lesson. The self-review is for your own reasoning. A score is not a certificate.