Request and Response Headers

View saved

Request headers you will see

  • Content-Type — body format you are sending
  • Accept — formats you can handle
  • Authorization — credentials
  • User-Agent — client identity

Response headers that help

  • Content-Type
  • Location after creates
  • Cache-Control for cacheable GETs
  • ETag / Last-Modified for conditional requests

Example exchange

A POST with JSON and an auth header.

POST /api/books HTTP/1.1
Host: api.example.com
Authorization: Bearer TOKEN
Content-Type: application/json

{"title":"Practical APIs"}

Custom headers

Prefix carefully (often X- is legacy). Prefer standard headers when they exist. Use correlation IDs for tracing across services.

Comments

One comment per signed-in account. Comments are saved with this page’s URL.