Web Protocols

X-Ray: HTTP Request

Client-Server Communication Structure

POST /api/v1/users HTTP/1.1

Host: api.example.com

Authorization: Bearer eyJhbGc...

Content-Type: application/json

Accept: application/json

User-Agent: Chrome/120.0

Content-Length: 89

Empty Line

{

"name": "Jane Doe",

"email": "jane@example.com",

"role": "admin"

}

Defines the action (e.g., GET, POST) that the client requests from the server on a specific resource.

Request Line

Method: Action (GET, POST).
URI: Path (/users/1).
Version: HTTP/1.1 or HTTP/2.

Headers

Key-value metadata (Host, Auth, Content-Type) providing context to the request.

Body (Optional)

Data sent to the server (JSON, Form), common in POST/PUT. Separated by an empty line.

Essential Headers

Authorization Authentication credentials
Content-Type Data type in the body
Accept Formats the client accepts
User-Agent Browser information
Cookie Client session data
Host Target server domain

🔒 HTTPS: In HTTPS connections, the entire request (request line, headers, and body) travels encrypted via TLS, protecting sensitive data like passwords, tokens, and personal information from malicious intermediaries.

logo xeland314
CLIENT requests • SERVER processes.