SlideShare a Scribd company logo
How Web Pages Work
and other ghost stories
Disclaimer
no math
no programming
no problem
How do computers talk?
How do computers talk?
How do computers talk?
How do computers talk?
How do computers talk?
How do computers talk?
Great, so how do they become friends?
Domain Name System
DNS translates domains into something computers understand
google.com means nothing
1.1.1.1 means something
Who do they talk to?
Who do they talk to?
IP address gets traffic to the computer
Ports get the traffic to the application
ex. 1.1.1.1:80
ex. fakewebpage.com:8080
What do they talk about?
Hyper Text Transfer Protocol (HTTP)
Transfers HTML (Hyper Text Markup Language)
Usually on port 80
HTTP Format
Verb and info
Headers, one per line
[blank line]
Optional body
HTTP Verbs
GET
POST
The other guys: PUT / PATCH / DELETE / HEAD
HTTP Headers
Host - name of the website we’re talking to
User agent - browser version
Cache - remember this, not gonna answer again
Cookies - magic
HTTP GET Requests
GET / HTTP/1.1
Host: oneis.us
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X) Firefox/44.0
Accept: text/html,application/xml
Accept-Language: en-US,en,es-MX
Accept-Encoding: gzip, deflate
Cookie: _ga=GA1.2.229765080.1436819046
Request sent!
Server gets request
Forwards it to the web server program
Web server gets the file requested
Sends response with requested file contents
HTTP Responses
HTTP/1.1 200 OK
Content-Length: 1241
Date: Mon, 01 Feb 2016 17:54:16 GMT
Content-Type: text/html;charset=utf-8
Server: WEBrick/1.3.1 (Ruby/1.8.7/2014-01-28)
[HTML body that’s 1241 characters long]
HTML (and CSS and JS and images and…)
HTTP Get Requests
GET /users.php?page=2 HTTP/1.1
Host: oneis.us
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X) Firefox/44.0
Accept: text/html,application/xml
Accept-Language: en-US,en,es-MX
Accept-Encoding: gzip, deflate
Cookie: _ga=GA1.2.229765080.1436819046
HTTP Responses
HTTP/1.1 404 Not Found
Content-Length: 28
Date: Mon, 01 Feb 2016 17:58:02 GMT
Content-Type: text/html;charset=utf-8
Server: WEBrick/1.3.1 (Ruby/1.8.7/2014-01-28)
Sorry, that code is unknown.
HTTP Status Codes
1xx - info
2xx - success
3xx - redirect
4xx - client error
5xx - server error
HTTP Post Request
HTTP Post Request
POST /api/set HTTP/1.1
Host: oneis.us
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X) Firefox/44.0
Accept: text/html,application/xml
Accept-Language: en-US,en,es-MX
api_key=lolidunno&submit=submit
HTTP Responses
HTTP/1.1 302 Found
Location: https://oneis.us/goaway
Date: Mon, 01 Feb 2016 18:02:39 GMT
Server: WEBrick/1.3.1 (Ruby/1.8.7/2014-01-28)
So what the hell are JS and PHP?
PHP runs “server side” (read: on the server)
Never sent to you, generates the HTML
JS runs “client side” (read: in your browser)
Included in HTTP response, manipulates HTML
JavaScript included in response
TL;DR
DNS Lookup
Sends request
Server gets reads or runs requested file
Server sends response back
Browser draws response from HTML
Browser requests any other needed files, runs JS
TL;DR
What didn’t we cover?
HTTPS
AJAX
Cookies
Caching
More learnins
You can watch this stuff IRL in your browser’s dev tools
Wikipedia’s HTTP page has some examples

More Related Content

PDF
How web crawlers work
PPT
Class 1 - World Wide Web Introduction
PDF
Introduction To Web (Mukesh Patel)
PPTX
Type URL, Enter, and Then …
PDF
PHP Streams: Lucky Dip
PDF
Introduction to Web Technology
PPT
Create your on personal website - PowerPoint Presentation
PDF
Demystifying SEO & Modern KPI Reporting
How web crawlers work
Class 1 - World Wide Web Introduction
Introduction To Web (Mukesh Patel)
Type URL, Enter, and Then …
PHP Streams: Lucky Dip
Introduction to Web Technology
Create your on personal website - PowerPoint Presentation
Demystifying SEO & Modern KPI Reporting

What's hot (8)

PDF
Javascript cross domain communication
PPTX
An Introduction To World Wide Web
PPTX
File formats
PPT
05 File Handling Upload Mysql
PPTX
PHP TUTORIAL
PDF
4 Basic PHP
PPT
introduction to web technology
PPT
slidesharenew1
Javascript cross domain communication
An Introduction To World Wide Web
File formats
05 File Handling Upload Mysql
PHP TUTORIAL
4 Basic PHP
introduction to web technology
slidesharenew1
Ad

Similar to How Web Pages Work (20)

PDF
PPTX
World Wide Web (WWW) Technology
ODP
PHP Training: Module 1
PPT
Under the Covers with the Web
PPTX
HTTP: the Other ESB
PPT
Introduction to the web
PDF
Computer network (10)
ODP
Starting With Php
PPT
Spider Course Day 1
PDF
Introduction to HTTP
PDF
20190516 web security-basic
PPTX
Webtechnologies
PPT
Web Fundamentals
PPTX
Rawnet Lightning talk 'How the Internet Works'
PDF
introduction_to_web_technology.pdf
PDF
IBM dwLive, "Internet & HTTP - 잃어버린 패킷을 찾아서..."
PDF
Node js oc meetup 2 socket io intro
ODP
HTTP Basic - PHP
PPT
Howthe internet
ODP
Web Server-Side Programming Techniques
World Wide Web (WWW) Technology
PHP Training: Module 1
Under the Covers with the Web
HTTP: the Other ESB
Introduction to the web
Computer network (10)
Starting With Php
Spider Course Day 1
Introduction to HTTP
20190516 web security-basic
Webtechnologies
Web Fundamentals
Rawnet Lightning talk 'How the Internet Works'
introduction_to_web_technology.pdf
IBM dwLive, "Internet & HTTP - 잃어버린 패킷을 찾아서..."
Node js oc meetup 2 socket io intro
HTTP Basic - PHP
Howthe internet
Web Server-Side Programming Techniques
Ad

Recently uploaded (20)

PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
Mushroom cultivation and it's methods.pdf
PDF
August Patch Tuesday
PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
PDF
Hybrid model detection and classification of lung cancer
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Web App vs Mobile App What Should You Build First.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PDF
Heart disease approach using modified random forest and particle swarm optimi...
PDF
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
PDF
Hindi spoken digit analysis for native and non-native speakers
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PPTX
Chapter 5: Probability Theory and Statistics
PDF
project resource management chapter-09.pdf
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
Group 1 Presentation -Planning and Decision Making .pptx
Mushroom cultivation and it's methods.pdf
August Patch Tuesday
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
Hybrid model detection and classification of lung cancer
Unlocking AI with Model Context Protocol (MCP)
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Web App vs Mobile App What Should You Build First.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
Heart disease approach using modified random forest and particle swarm optimi...
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
Hindi spoken digit analysis for native and non-native speakers
Assigned Numbers - 2025 - Bluetooth® Document
Univ-Connecticut-ChatGPT-Presentaion.pdf
Chapter 5: Probability Theory and Statistics
project resource management chapter-09.pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
SOPHOS-XG Firewall Administrator PPT.pptx

How Web Pages Work

  • 1. How Web Pages Work and other ghost stories
  • 9. Great, so how do they become friends? Domain Name System DNS translates domains into something computers understand google.com means nothing 1.1.1.1 means something
  • 10. Who do they talk to?
  • 11. Who do they talk to? IP address gets traffic to the computer Ports get the traffic to the application ex. 1.1.1.1:80 ex. fakewebpage.com:8080
  • 12. What do they talk about? Hyper Text Transfer Protocol (HTTP) Transfers HTML (Hyper Text Markup Language) Usually on port 80
  • 13. HTTP Format Verb and info Headers, one per line [blank line] Optional body
  • 14. HTTP Verbs GET POST The other guys: PUT / PATCH / DELETE / HEAD
  • 15. HTTP Headers Host - name of the website we’re talking to User agent - browser version Cache - remember this, not gonna answer again Cookies - magic
  • 16. HTTP GET Requests GET / HTTP/1.1 Host: oneis.us User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X) Firefox/44.0 Accept: text/html,application/xml Accept-Language: en-US,en,es-MX Accept-Encoding: gzip, deflate Cookie: _ga=GA1.2.229765080.1436819046
  • 17. Request sent! Server gets request Forwards it to the web server program Web server gets the file requested Sends response with requested file contents
  • 18. HTTP Responses HTTP/1.1 200 OK Content-Length: 1241 Date: Mon, 01 Feb 2016 17:54:16 GMT Content-Type: text/html;charset=utf-8 Server: WEBrick/1.3.1 (Ruby/1.8.7/2014-01-28) [HTML body that’s 1241 characters long]
  • 19. HTML (and CSS and JS and images and…)
  • 20. HTTP Get Requests GET /users.php?page=2 HTTP/1.1 Host: oneis.us User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X) Firefox/44.0 Accept: text/html,application/xml Accept-Language: en-US,en,es-MX Accept-Encoding: gzip, deflate Cookie: _ga=GA1.2.229765080.1436819046
  • 21. HTTP Responses HTTP/1.1 404 Not Found Content-Length: 28 Date: Mon, 01 Feb 2016 17:58:02 GMT Content-Type: text/html;charset=utf-8 Server: WEBrick/1.3.1 (Ruby/1.8.7/2014-01-28) Sorry, that code is unknown.
  • 22. HTTP Status Codes 1xx - info 2xx - success 3xx - redirect 4xx - client error 5xx - server error
  • 24. HTTP Post Request POST /api/set HTTP/1.1 Host: oneis.us User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X) Firefox/44.0 Accept: text/html,application/xml Accept-Language: en-US,en,es-MX api_key=lolidunno&submit=submit
  • 25. HTTP Responses HTTP/1.1 302 Found Location: https://oneis.us/goaway Date: Mon, 01 Feb 2016 18:02:39 GMT Server: WEBrick/1.3.1 (Ruby/1.8.7/2014-01-28)
  • 26. So what the hell are JS and PHP? PHP runs “server side” (read: on the server) Never sent to you, generates the HTML JS runs “client side” (read: in your browser) Included in HTTP response, manipulates HTML
  • 28. TL;DR DNS Lookup Sends request Server gets reads or runs requested file Server sends response back Browser draws response from HTML Browser requests any other needed files, runs JS
  • 29. TL;DR
  • 30. What didn’t we cover? HTTPS AJAX Cookies Caching
  • 31. More learnins You can watch this stuff IRL in your browser’s dev tools Wikipedia’s HTTP page has some examples