1. Client and Server
- Client → Usually your browser (Chrome, Firefox, Edge) or a mobile app.
- It requests resources (like web pages, images, or APIs).
- Server → The computer that hosts the website or application.
- It processes the request and sends back a response.
📌 Example:
When you type https://example.com in your browser:
- Client (your browser) sends a request to the server.
- Server processes it and sends back the HTML/CSS/JS that builds the page.
2. Request-Response Cycle
- DNS Resolution → Your system finds the server’s IP address for
example.com.
- TCP Connection → Client and server establish a connection (using TCP/IP).
- TLS/SSL Handshake (if HTTPS) → Secure encryption is set up.
- HTTP Request → Browser sends a request (GET/POST/PUT/DELETE).
- Server Processing → Server checks database, runs backend code (PHP, Node.js, Python, etc.).
- HTTP Response → Server sends data back (status code + content).
- Rendering → Browser displays the page using HTML, CSS, JS.