Lessons › coding and computer science · taught by Leo
How websites talk to each other
Learn how browsers, servers, requests, responses, and HTTP work together to load a web page.
Learn this with Leo, freeA voiced lesson with a live whiteboard, quizzes and a tutor you can call, at tutelage.appA website is a conversation
Think of a website like a conversation. Your device asks, and a server answers.
The computer you use is the client.
The machine that stores the website is the server.
Client sends a request
First, you do something like click a link or type a web address.
That makes the browser send a request.
A request is just a message that says what page you want.
Predict the next step
After you click a link, what happens next?
- The browser sends a request
- The server disappears
- The page is already on your screen
Show answer
The browser sends a request: Yes. The browser sends a request to the server.
Server sends back data
Here is the whole exchange in order.
The browser asks for a page, the server finds the files, then sends them back.
The browser then builds the page you can see and click.
Why HTML, CSS, and JS matter
Different files do different jobs.
HTML gives the structure. CSS makes it look nice.
JavaScript adds behavior, like opening menus or checking forms.
What builds the look?
Which file is mainly about colors, spacing, and layout?
- HTML
- CSS
- HTTP
Show answer
CSS: Correct. CSS controls the style and layout.
A page is files plus rules
A website is not one magical thing. It is files on a server, plus a browser that asks for them and assembles them.
The server stores the files.
The browser requests them.
The browser puts them together into a page.
The web uses a common language
Browsers and servers need a shared language. That language is HTTP.
HTTP carries the request and the response.
The response often includes HTML, CSS, and JavaScript.
What is HTTP doing?
What is HTTP mainly used for?
- Painting buttons
- Sending requests and responses
- Saving the internet
Show answer
Sending requests and responses: Yes. HTTP is the message system between browser and server.
Watch out: server is not the site
A common mistake is thinking the server is the website itself.
The server stores the files. The browser view is what you see on screen.
Your turn: choose the server role
Which job belongs to the server?
- Store and send website files
- Draw the page on your screen
- Type the URL
Show answer
Store and send website files: Right. The server stores files and sends them when asked.
Remember the web flow
Use this checklist whenever you think about a website.
You do something, the browser requests, the server responds, and the browser shows the page.
That is the basic client-server loop.