What you will learn
The base URL identifies a service; the path identifies a resource. A query begins after ? and uses & between parameters. A space in a query is written as %20. An ampersand inside a value is written as %26, otherwise it starts a new parameter.
Your goals
- Separate base URL, path and query.
- Send spaces and reserved characters as intended data.
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 the search for John Doe. Before you send, look at the URL and separate the origin, the path, and the query after the question mark. A space in the search text is written as %20. Select that response.
- Read meta.total in that response. An empty data list can still be a successful search.
- Send the second search. %26 inside the query stands for an & that is part of the search text. Select that response.
- Copy both meta.total values. For the path, copy the resource path from the URL, the part before the question mark.
- 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
- Space and ampersand are encoded within the value.
- Both totals are read from the actual responses.
- The path is separated from the query.
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
- Space and ampersand are encoded within the value.
- Both totals are read from the actual responses.
- The path is separated from the query.
Construct a query containing a literal +, then inspect which text the server searched.
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.