A URL is the complete address used to access resources online. Example:
https://example.com:443/products?id=3#details


Parts:
| Part | Example | Description |
|---|---|---|
| Protocol | https |
Communication method (HTTP or HTTPS) |
| Domain | example.com |
The serverโs domain name |
| Port | :443 |
Optional โ Port used for connection |
| Path | /products |
Resource location on the server |
| Query string | ?id=3 |
Parameters sent to the server (key=value) |
| Fragment | #details |
Used by the browser to scroll to a section |
The client sends a request to ask for data or perform an action.
Parts of a Request:
GET /api/users HTTP/1.1
| Header | Purpose |
|---|---|
Authorization |
Sends credentials (Bearer token or Basic Auth) |
Content-Type |
Describes body format (e.g., application/json) |
User-Agent |
Info about browser/device |
Accept |
Expected response format (e.g., application/json) |
Cookie |
Sends cookies stored in the browser |
Referrer |
Page where user came from |
Content-Length |
Body size in bytes |
The server replies with a response that includes: