Postman Tutorial Part 6 – Understand HTTP Headers in API

Hello Folks,

We have already learnt about :

Sending GET request in Postman.

Sending POST request in Postman.

If you notice, you can see a “Headers” tab in both request and response section of Postman. When you click on that tab you can see many key-value pairs.

We will see about headers in this post. This is also an interview question.

“Headers” or “HTTP Headers” are key – value pairs which are used by Server and Client to exchange additional information about Request and Response. We can also say that headers are metadata of Request and Response. 

Some headers you need to pass in Request and some headers are automatically added at run time with request. When response body is returned, it also includes many headers.

In above image, “Authorization” is a header of request which is automatically added when we pass access token. When we hit Get request, we got response. This response contains 16 headers (Server, Date etc.).

Some important headers are:

  1. Authorization
  2. Content-ID
  3. Content-Length
  4. Content-Type
  5. Date
  6. Connection
  7. Accept
  8. If-Match
  9. If-None-Match
  10. Location
  11. Range

 

More about API Testing in upcoming posts. Stay tuned.

If you have any doubt, feel free to comment below.
If you like my posts, please like, comment, share and subscribe.
#ThanksForReading
#HappyApiTesting

Leave a Reply

Your email address will not be published. Required fields are marked *