API Testing Tutorial Part 18 – 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 dat 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

Author: Amod Mahajan

My name is Amod Mahajan and I am an IT employee with 6+ years of experience in Software testing and staying in Bengaluru. My area of interest is Automation testing. I started from basics and went through so many selenium tutorials. Thanks to Mukesh Otwani as his tutorials are easy and cover basics to advance. I have habit of exploring concepts by deep diving. I used to make notes. I thought of sharing my knowledge through posts and now I am here. #KeepLearning #ShareLearning