Sobes.tech
Middle

What does an HTTP request consist of?

sobes.tech AI

Answer from AI

An HTTP request consists of several parts:

  1. Request Line — contains the method (GET, POST, etc.), URL, and protocol version.
  2. Headers — key-value pairs that convey meta-information (e.g., Content-Type, Authorization).
  3. Empty line — separates headers and body.
  4. Request Body — optional part that contains data (e.g., in a POST request).

Example of a request line and headers:

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

{"name":"John"}
What does an HTTP request consist of? — QA / QA… - sobes.tech