Lecture Notes for Client-Server Interfaces

30 March 2004 - Fun with HTTP


Telnet and Web Servers


A Failing Head Request

*cl telnet bluehawk.monmouth.edu 80
 Trying 204.152.149.5...
 Connected to bluehawk.monmouth.edu.
 Escape character is '^]'.
*HEAD /rclayton/nonexistent.html HTTP/1.0
*
 HTTP/1.1 404 Not Found
 Date: Tue, 06 Apr 2004 21:42:22 GMT
 Server: Apache/1.3.26 (Unix) PHP/4.1.2
 Last-Modified: Sun, 07 Mar 1999 21:23:21 GMT
 ETag: "ca0a7-3a9-36e2ee49"
 Accept-Ranges: bytes
 Content-Length: 937
 Connection: close
 Content-Type: text/html

 Connection closed by foreign host.

 cl


A Successful Head Request

*cl telnet bluehawk.monmouth.edu 80
 Trying 204.152.149.5...
 Connected to bluehawk.monmouth.edu.
 Escape character is '^]'.
*HEAD /rclayton/weather.html HTTP/1.0
*
 HTTP/1.1 200 OK
 Date: Tue, 06 Apr 2004 21:42:33 GMT
 Server: Apache/1.3.26 (Unix) PHP/4.1.2
 Last-Modified: Wed, 09 Apr 2003 20:39:05 GMT
 ETag: "605cc-80b-3e9484e9"
 Accept-Ranges: bytes
 Content-Length: 2059
 Connection: close
 Content-Type: text/html
 X-Pad: avoid browser bug

 Connection closed by foreign host.

 cl 


An Unsuccessful Get

*cl telnet bluehawk.monmouth.edu 80
 Trying 204.152.149.5...
 Connected to bluehawk.monmouth.edu.
 Escape character is '^]'.
* GET /rclayton/nonexistent.html HTTP/1.0
*
 HTTP/1.1 404 Not Found
 Date: Tue, 06 Apr 2004 21:26:41 GMT
 Server: Apache/1.3.26 (Unix) PHP/4.1.2
 Last-Modified: Sun, 07 Mar 1999 21:23:21 GMT
 ETag: "ca0a7-3a9-36e2ee49"
 Accept-Ranges: bytes
 Content-Length: 937
 Connection: close
 Content-Type: text/html

 <HTML>
 <HEAD><TITLE>Page Not Found</TITLE></HEAD>

 <body>
 <CENTER>Page not found!</CENTER>
 </body>
 </html>
 Connection closed by foreign host.

 cl 


A Successful Get

*cl telnet www.monmouth.edu 80
 Trying 204.152.149.5...
 Connected to www.monmouth.edu.
 Escape character is '^]'.
*GET /rclayton/weather.html HTTP/1.0
*
 HTTP/1.1 200 OK
 Date: Tue, 27 Mar 2001 20:11:38 GMT
 Server: Apache/1.3.6 (Unix)
 Last-Modified: Fri, 23 Mar 2001 01:06:07 GMT
 ETag: "605c1-7cf-3abaa17f"
 Accept-Ranges: bytes
 Content-Length: 1999
 Connection: close
 Content-Type: text/html

 <HTML>

 <HEAD><TITLE> Weather </TITLE></HEAD>

 <BODY> [ blah blah blah ] </BODY>

 </HTML>

 Connection closed by foreign host.

 cl 


HTTP 1.0 vs HTTP 1.1

*cl telnet www.monmouth.edu 80
 Trying 204.152.149.5...
 Connected to www.monmouth.edu.
 Escape character is '^]'.
*GET /rclayton/weather.html HTTP/1.1
*
 HTTP/1.1 400 Bad Request
 Date: Tue, 27 Mar 2001 20:15:35 GMT
 Server: Apache/1.3.6 (Unix)
 Connection: close
 Transfer-Encoding: chunked
 Content-Type: text/html

 198
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <HTML><HEAD>
 <TITLE>400 Bad Request</TITLE>
 </HEAD><BODY>
 <H1>Bad Request</H1>
 Your browser sent a request that this server could 
 not understand.<P>
 client sent HTTP/1.1 request without hostname (see 
 RFC 2068 section 9, and 14.23): 
 /rclayton/web-pages/me/weather.html<P>
 <HR>
 <ADDRESS>
 Apache/1.3.6 Server at www.monmouth.edu Port 80
 </ADDRESS></BODY></HTML>

 0

 Connection closed by foreign host.

 cl


A Good HTTP 1.1 Get

*cl telnet www.monmouth.edu 80
 Trying 204.152.149.5...
 Connected to www.monmouth.edu.
 Escape character is '^]'.
*GET /rclayton/web-pages/me/weather.html HTTP/1.1
*Host: www.monmouth.edu:80
*
 HTTP/1.1 200 OK
 Date: Tue, 27 Mar 2001 20:19:38 GMT
 Server: Apache/1.3.6 (Unix)
 Last-Modified: Fri, 23 Mar 2001 01:06:07 GMT
 ETag: "605c1-7cf-3abaa17f"
 Accept-Ranges: bytes
 Content-Length: 1999
 Content-Type: text/html

 <html>

 <head><TITLE> Weather
 </TITLE></HEAD>

 <BODY> [ blah blah blah ] </BODY>

 </HTML>

 Connection closed by foreign host.

 cl


This page last modified on 17 January 2004.