5. • A protocol to transfer resources (== files)
• System of request / response
• Between a client and a server
HTTP
6. When a user…
• Clicks on a link, or
• Types a url in the address bar, or
• Submits a form…
7. The client sends…
An HTTP request to the server
HTTP request
with URL
GET https://lewagon.com
8. The server receives…
…the HTTP request
If the content asked is static
(GET http://lewagon.com)
The server fetches the
HTML file
And sends it back to the
client in the HTTP response
9. The server receives…
…the HTTP request
If the content asked is dynamic
(GET http://facebook.com/zuck is a different HTML
than http://facebook.com/boris.paillard)
The server builds the
HTML file
using server language (php/Ruby/
Python…) and SQL queries to Database
And sends it back to the
client in the HTTP response
Ruby
SQL
DB
10. HTTP request
with URL
GET https://lewagon.com
The browser processes…
…the HTML file to display the web page
HTTP response
with HTML file
11. Flow Recap.
• When a user clicks on a link / types a URL / submits a form
• The client sends (via a browser) an HTTP request to a server
• The server builds an HTML file (which is just text)
• The server sends it back to the client in an HTTP response
• The client processes the HTML file to display the web page
On a website…