Lecture Notes for Client-Server Interfaces

26 March 2002 - Fun with HTTP


Telnet and Web Servers


An Unsuccessful 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/nonexistent.html HTTP/1.0
*
 HTTP/1.1 404 Not Found
 Date: Tue, 27 Mar 2001 20:01:22 GMT
 Server: Apache/1.3.6 (Unix)
 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>

 [ blah blah blah ]

 </body>
 </html>
 Connection closed by foreign host.

 cl


A Head Request

*cl telnet www.monmouth.edu 80
 Trying 204.152.149.5...
 Connected to www.monmouth.edu.
 Escape character is '^]'.
*HEAD /rclayton/web-pages/me/nonexistent.html HTTP/1.0
*
 HTTP/1.1 404 Not Found
 Date: Tue, 27 Mar 2001 20:10:39 GMT
 Server: Apache/1.3.6 (Unix)
 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 telnet www.monmouth.edu 80
 Trying 204.152.149.5...
 Connected to www.monmouth.edu.
 Escape character is '^]'.
*HEAD /rclayton/web-pages/me/weather.html HTTP/1.0
*
 HTTP/1.1 200 OK
 Date: Tue, 27 Mar 2001 20:11:06 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

 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/web-pages/me/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/web-pages/me/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 21 March 2002.