DEV Community

Salman Asu
Salman Asu

Posted on

2 2 2 2 2

HTTP Headers in API

http header are the field in http api request and response.

it is like setting up the address from and to in sending envelop to postman.

similarly http header are doing so.
*simple request header *

Image description

response header for same request

Image description

** some of build in header are **

  • host
  • path
  • content-type and many other refer doc

_u can add own custom header. _
like req.setHeader("X-myname","sallbro");
it is best practise to add X before name of header to identify it is custom header.

Top comments (0)

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay