Recall & Review
beginner
What are response headers in API testing?
Response headers are pieces of information sent by the server back to the client along with the response body. They describe details like content type, server info, caching policies, and more.
Click to reveal answer
beginner
Name two common response headers you might check in Postman.
Common response headers include
Content-Type (tells the format of the response data) and Server (provides information about the server software).Click to reveal answer
intermediate
How can you verify response headers in Postman tests?
You can write tests in Postman using JavaScript to check if specific headers exist or have expected values, for example: <br>
pm.test('Content-Type is JSON', () => { pm.response.to.have.header('Content-Type', 'application/json'); });Click to reveal answer
beginner
Why is checking response headers important in API testing?
Response headers provide metadata about the response. Checking them ensures the server behaves correctly, like sending the right content type or security policies, which affects how clients handle the response.
Click to reveal answer
intermediate
What does the
Cache-Control response header do?The
Cache-Control header tells the client or browser how to cache the response. For example, it can say to not cache at all or to cache for a certain time.Click to reveal answer
Which response header tells the client the format of the returned data?
✗ Incorrect
The Content-Type header specifies the media type of the response body, such as application/json or text/html.
In Postman, how do you check if a response header exists in a test script?
✗ Incorrect
The correct syntax to check for a header in Postman test scripts is pm.response.to.have.header('Header-Name').
What does the Cache-Control header control?
✗ Incorrect
Cache-Control tells clients or browsers how to cache the response data.
Which header would you check to confirm the server's software information?
✗ Incorrect
The Server header often contains information about the server software handling the request.
Why might you test response headers in API testing?
✗ Incorrect
Testing response headers ensures the server sends correct metadata that affects how clients process the response.
Explain what response headers are and why they matter in API testing.
Think about the extra information the server sends besides the main data.
You got /3 concepts.
Describe how you would write a Postman test to check if the response has a specific header with a certain value.
Use JavaScript syntax inside Postman test scripts.
You got /3 concepts.