Sobes.tech
Junior — Middle

Can you name the main types of headers used in HTTP requests?

sobes.tech AI

Answer from AI

Main types of HTTP headers used in requests:

  • General headers: apply to both requests and responses, e.g., Cache-Control, Connection.
  • Request headers: contain information about the client and request, e.g., Host, User-Agent, Accept, Authorization, Cookie.
  • Entity headers: describe the message body, e.g., Content-Type, Content-Length, Content-Encoding.

Example:

GET /index.html HTTP/1.1
Host: example.com
User-Agent: Mozilla/5.0
Accept: text/html
Authorization: Bearer token123