Lecture 0 "HTTP" - Building Dynamic Websites - Part2
Summary: This is the first lecture of the series. Building Dynamic Websites by Harvard OpenCourseWare with Great Instructor David J. Malan
The real meat of Lecture #0 starts at 1:18:00.
Course Web Site by CS75.tv
Course Sillabus (Opens in a PDF)
Course Sections Lead By TA
Course Projects
The course's own website is at www.cs75.net.
Google Discussion Group
Lecture 0: HTTP |
Lecture #0 Summary
Part-1- http protocol
- Look at the http header
- How "internet" find the host, e.g. google.com, specified in a URL
- How query parameter in a URL is passed
- DHCP
- Connecting to a remote host via telnet with IP address
Part-2
- GET / HTTP/1.1 command in telnet
- HTTP/1.1 400 bad request
- HTTP/1.1 Error 301 - Moved permanently
- dhcp commad
- dhcp nslookup cnn.com and check the IP address
- /private/etc/hosts file for host database that lists 127.0.0.1 for localhost
- Use Chrome advanced feature for a developer to inspect the HTML element for style (button length)
0.2 Let's look at the HTTP header
0.2.1 Simple Front-End Demo By "Google Search"
=================================
Source Code for front-end
=================================
<!DOCTYPE html>
<html>
<head>
<title>Google</title>
</head>
<body>
<div style="text-align: center">
<h1>Google</h1>
<form action="http://www.google.com/search" method="get">
<input name="q" style="width: 300px" type="text">
<br>
<input type="submit" value="Google Search">
<input type="submit" value="I'm Feeling Lucky">
</form>
</div>
</body>
</html>
0.2.2 Let's Look At HTTP Traffic
Open the Chrome developer tool as shown below.HTTP GET Request Headers
By default telnet uses TCP port#21.
Below, telnet is specified to use the TCP port#80.
Here on the last command, pretend being a browser and send "GET / HTTP/1.1".
The server responded with a "400 Bad Request", because pretended being a browser, but did not send a browser header. (A browser header was missing in the HTTP request manually sent from telnet.)
Host: harvard.edu
Server sent an error code 301 - Permanent redirect