Web Week1 Notes
Web Week1 Notes
Client-Server Model
- Client: A device or application (e.g., browser) that initiates requests.
- Server: A machine or application that listens for requests and responds with data.
Examples:
- Browsing Facebook: Client → Request for profile page → Server sends HTML/CSS/JS
- Filling a form: Client → POST request → Server processes and returns success/failure
Protocols Involved:
- DNS (Domain Name System)
- TCP/IP (Transmission Control Protocol / Internet Protocol)
- HTTP/HTTPS (HyperText Transfer Protocol)
Key Concepts:
- Statelessness: Each HTTP request is independent.
- Port 80: Default for HTTP
- Port 443: Default for HTTPS
📺 Recommended Video: How the Web Works in 10 Minutes – Tech With Tim
https://www.youtube.com/watch?v=J8hzJxb0rpc
Example:
<form action="/submit" method="post">
<input type="text" name="username" />
<input type="password" name="password" />
<button type="submit">Login</button>
</form>
Example:
body {
font-family: Arial;
background-color: #f4f4f4;
}
form {
padding: 20px;
border: 1px solid #ccc;
}
JavaScript:
- Adds interactivity and logic
- Used for DOM manipulation, event handling, form validation
Example:
document.querySelector("form").addEventListener("submit", function(e) {
let username = document.querySelector("input[name='username']").value;
if (username === "") {
alert("Username is required!");
e.preventDefault();
}
});
How to Use:
1. Open DevTools (Right-click → Inspect → Network tab)
2. Reload the page
3. Observe requests:
- Method (GET/POST)
- Status (200, 404, etc.)
- Size (how much data is transferred)
- Time (how long request takes)
Analyzing a Request:
- Click a request → View:
- Headers: Request & response headers
- Payload: Data sent in POST
- Preview: HTML/CSS/JSON response
- Timing: Breakdown of request lifecycle
Use Cases:
- Check if a login form is secure
- See if data is sent in plain text
- Debug API requests in web apps
📺 Recommended Video: Inspect HTTP Requests with Chrome DevTools – Google Chrome
Developers
https://www.youtube.com/watch?v=e1gAyQuIFQo
✅ Summary
In Week 1, learners should:
- Grasp how the web works (client-server model)
- Understand HTTP(S) and key methods/status codes
- Build foundational knowledge of HTML, CSS, and JavaScript
- Begin using browser DevTools to inspect real network traffic