HTTP

Let's lift the hood and check out the engine that makes the World Wide Web run.

Browsers - what do they do?

Request - Response

HTTP Request (via https://betterexplained.com/)

HTTP Methods

HTTP is a protocol that allows clients to communicate with web servers, and is a primary underlying infrastructure of the Internet. The two most common HTTP methods are:

When a URL is inputted, the browser sends a GET request to a web server. When a form is submitted on a website, a POST request is submitted, and the browser hands off the form data to be handled by the web server.

(There are several more HTTP Methods but GET and POST are used for 99.99%+ of Web traffic.)

DNS

DNS illustration

Remember, websites live at an IP Address. This is a string of numbers, (ex. 70.42.251.42) that locates a specific computer (or "host") on the Internet. A domain name is simply a translation that provides humans with an easy way to remember where a website lives.

Other DNS Info

Your nameservers may also contain other information about your domain, such as where your email server lives. For example, if I try to send an email to mark@facebook.com, your email server is going to communicate with the nameserver for facebook.com and say, "Where does this email server live?".

HTTP: File Transfer for the Web

Examples of Web Code

Web code can be any language used to create web pages or applications. Common examples of these are

The above languages run inside the web browser (aka "the client side"). On the server side, there is a lot more variation. You may encounter...

HTTP 0.9 Goals (1991)

HTTP 1.0 (1993-1996)

HTTP 1.0 protocol

Step Client Server
open connection telnet example.com 80
request a resource GET /index.html HTTP/1.0
request headers User-Agent: Dogscape 1.0
blank line
response status HTTP/1.0 200 OK
response headers Content-Type: text/html
Content-Length: 12340
blank line
response body <html><body>...

HTTP 1.0 details

HTTP telnet example

telnet is the original program for connecting to other computers on the Internet.

Unfortunately, many modern OSs don't ship with a working version of telnet, so you should watch your instructor's terminal, or skip ahead to the next slide.

$ telnet google.com 80

That opens a connection to one of Google's many web servers.

In HTTP, the client starts the conversation, so type this and hit Enter:

GET /

then the server replies with an HTTP response!

If you have a working telnet, try this yourself. Also try telnet towel.blinkenlights.nl .

Telnet Screenshot

telnet screenshot

 Previous Lesson Next Lesson 

Outline

[menu]

/