The web: request-response
This course follows a web request from the moment a URL is typed to the moment the page appears. It covers URL parsing, DNS lookup, the TCP handshake, and the client-server model built on stateless HTTP. It breaks down the parts of HTTP requests and responses, including methods, headers, bodies and status codes. It traces a request through Puma, Rack middleware, the router, controllers, models and views in Rails. It also explains cookies, sessions, flash messages and CSRF tokens, and shows debugging with DevTools, curl, Rails logs and integration tests.
What you'll learn
- ✓The steps from typing a URL to rendering a page
- ✓How clients, servers and stateless HTTP fit together
- ✓The structure of HTTP requests, responses and status codes
- ✓How Rails passes a request through middleware, router, controller, model and view
- ✓How cookies, sessions, flash messages and CSRF tokens keep state
- ✓Debugging HTTP with DevTools, curl, Rails logs and integration tests
What happens when you visit a URL?
Every time you type a URL or click a link, a complex sequence of events happens in milliseconds. Understanding this journey is the foundation of web development: because every feature you build in Rails is part of this cycle.
Read the full lesson free →Curriculum
7 lessonsWhat happens when you visit a URL?
Traces a visit through URL parsing, DNS lookup, TCP handshake, HTTP request, Rails processing, response and rendering.
The client-server model
Explains clients, server layers like Nginx and Puma, stateless HTTP and paired request-response cycles.
Anatomy of an HTTP request
Breaks a request into request line, headers and body, and shows how Rails reads it through params.
Anatomy of an HTTP response
Covers the status line, status code categories, response headers and body, plus render and redirect_to in Rails.
The Rails request lifecycle
Follows a request inside Rails through Puma, middleware, router, controller, models, views and layout.
Headers, cookies, and sessions
Shows how cookies, Rails sessions, flash messages and CSRF tokens add state to stateless HTTP.
Request-response in practice
Uses DevTools, curl, Rails logs and integration tests to inspect and debug common HTTP problems.