0
0
Postmantesting~5 mins

Response headers in Postman - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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?
AAccept
BContent-Type
CUser-Agent
DAuthorization
In Postman, how do you check if a response header exists in a test script?
Apm.response.hasHeader('Header-Name')
Bpm.request.to.have.header('Header-Name')
Cpm.testHeader('Header-Name')
Dpm.response.to.have.header('Header-Name')
What does the Cache-Control header control?
AThe HTTP method used
BThe server's IP address
CHow the response is cached by clients
DThe response status code
Which header would you check to confirm the server's software information?
AServer
BContent-Length
CHost
DReferer
Why might you test response headers in API testing?
ATo verify metadata like content type and security policies
BTo check the client’s IP address
CTo change the request method
DTo modify the response body
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.