An example request is a sample HTTP request sent to an API endpoint to test if it behaves as expected. It includes method, URL, headers, and body if needed.
Click to reveal answer
beginner
What does an example response show in API testing?
An example response shows the data and status code returned by the API after a request. It helps verify if the API returns correct and expected results.
Click to reveal answer
beginner
Why use example requests and responses in Postman?
They help testers understand how the API works, create automated tests, and document the API for others to use easily.
Click to reveal answer
beginner
What is a common HTTP method used in example requests?
GET is a common HTTP method used to request data from an API without changing anything on the server.
Click to reveal answer
intermediate
How can you validate an example response in Postman?
You can write tests in Postman using JavaScript to check if the response status code and body data match expected values.
Click to reveal answer
What does an example request in Postman typically include?
AOnly the response body
BOnly the URL
CHTTP method, URL, headers, and body
DOnly the response status code
✗ Incorrect
An example request includes the HTTP method (like GET or POST), the URL, headers, and optionally a body.
Which HTTP method is used to retrieve data without changing the server state?
AGET
BPUT
CPOST
DDELETE
✗ Incorrect
GET requests data from the server without modifying it.
What is the purpose of example responses in API testing?
ATo show how the API should respond to requests
BTo send data to the server
CTo create new API endpoints
DTo delete data from the server
✗ Incorrect
Example responses demonstrate the expected output from the API after a request.
How can you check if an API response is correct in Postman?
ABy sending multiple requests at once
BBy only looking at the URL
CBy changing the HTTP method
DBy writing tests that assert status codes and response data
✗ Incorrect
Postman allows writing tests to verify response status and content.
Why is documenting example requests and responses useful?
AIt slows down testing
BIt helps others understand how to use the API
CIt hides API details
DIt deletes old API versions
✗ Incorrect
Documentation with examples makes APIs easier to learn and use.
Explain what an example request and response are in API testing and why they are important.
Think about how you check if an API works correctly.
You got /3 concepts.
Describe how you would validate an example response in Postman.
Consider writing simple JavaScript assertions.
You got /3 concepts.
Practice
(1/5)
1. What is the main purpose of example requests and responses in Postman?
easy
A. To design website layouts
B. To create new APIs automatically
C. To write backend server code
D. To show how to use an API step-by-step
Solution
Step 1: Understand the role of example requests
Example requests demonstrate how to call an API with real data.
Step 2: Understand the role of example responses
Example responses show what the API returns for those requests.
Final Answer:
To show how to use an API step-by-step -> Option D
Quick Check:
Example requests + responses = API usage guide [OK]
Hint: Examples explain API use clearly and simply [OK]
Common Mistakes:
Thinking examples create APIs
Confusing examples with coding
Assuming examples design UI
2. Which of the following is the correct way to add an example response in Postman?
easy
A. Change the request method to POST
B. Click 'Save Response' after sending a request
C. Edit the URL in the Params tab
D. Write code in the Tests tab
Solution
Step 1: Identify how to save example responses
After sending a request, Postman allows saving the response as an example.
Step 2: Confirm the correct action
Clicking 'Save Response' saves the current response as an example for future reference.
Final Answer:
Click 'Save Response' after sending a request -> Option B
Quick Check:
Save response = example response [OK]
Hint: Save response after request to create example [OK]
Common Mistakes:
Trying to add examples by editing URL
Confusing Tests tab with examples
Changing method does not save examples
3. Given this example request in Postman:
{
"name": "Alice",
"age": 30
}
And this example response:
{
"id": 101,
"name": "Alice",
"age": 30
}
What does the response show?
medium
A. The API ignores the age field
B. The API returns an error because of missing fields
C. The API returns the user data with a new ID
D. The API returns only the ID
Solution
Step 1: Compare request and response fields
The request sends name and age; the response adds an id field.
Step 2: Understand the meaning of added id
The id is usually a unique identifier assigned by the API to the new user.
Final Answer:
The API returns the user data with a new ID -> Option C
Quick Check:
Response adds id to request data [OK]
Hint: Response adds new info like ID to request data [OK]
Common Mistakes:
Assuming error without error message
Ignoring added id field
Thinking age is removed
4. You saved an example response in Postman, but it shows outdated data. What is the best way to fix this?
medium
A. Send the request again and save the new response as example
B. Edit the example response manually in the editor
C. Delete the request and create a new one
D. Change the request URL to a different API
Solution
Step 1: Identify how to update example responses
Example responses reflect saved data; to update, you must get fresh data from the API.
Step 2: Choose the correct update method
Sending the request again gets current data; saving it updates the example correctly.
Final Answer:
Send the request again and save the new response as example -> Option A
Quick Check:
Refresh example by resending and saving response [OK]
Hint: Resend request and save response to update example [OK]
Common Mistakes:
Editing example manually can cause errors
Deleting request is unnecessary
Changing URL changes API, not example
5. You want to create an example request and response in Postman to show how to update a user's email. Which steps should you follow?
hard
A. Send a PUT request with new email, then save the response as example
B. Write the new email in the Tests tab and save the request
C. Change the request method to GET and save the response
D. Delete the user and create a new example request
Solution
Step 1: Use the correct HTTP method for update
PUT is the standard method to update existing data like email.
Step 2: Save the response after sending the update request
Saving the response as example shows the API's reply to the update.
Final Answer:
Send a PUT request with new email, then save the response as example -> Option A
Quick Check:
Update with PUT + save response example [OK]
Hint: Use PUT for update, then save response example [OK]
Common Mistakes:
Using GET instead of PUT for update
Editing Tests tab does not create examples
Deleting user is unrelated
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.