CS 314 Lab 1. Exploring HTTP HW by Tom Barstow. Due: 5/19 5 PM Submitted @ 1:30 PM on 5/18 A Word Format Version Exists as lab1.doc ========================================== Manual HTTP Requests In the in-class exercise, you established a telnet connection to a web server and issued HTTP commands manually. Using the same procedure, issue the requests shown below and then answer the questions. #1 Issue a GET request for www.bgsu.edu/hidden.html using HTTP/1.1 #2 Issue a HEAD request for www.bgsu.edu/index.html using HTTP/1.1 #3 Repeat #2 using HTTP/1.0 #4 Issue a HEAD request for index.html from www.ebay.com using HTTP/1.1. #5 Issue a GET request for the same resource as #4. See Log Attached At End For Verification. ========================================== Questions: What was the response code for request #1 above? 400. How did the server responses to #2 and #3 compare? #2 (HTTP/1.1) returned a code of 400 (status code for a bad request), but #3 (HTTP/1.0) returned a code of 403 (which is the status code for forbidden... ) What is the Content-length from request #4? 4009 How does the server response to request #4 differ from its response to request #5 ? (both request the same resource). In #4 & #5 it returns the code 400 (status code for a bad request), but the difference in the servers response to our requests is that #4 does not include the entity body (because the HEAD command was used) where as in #5 the GET command is used so an entity body is returned (ie. HTML is returned). ========================================== Client Requests. The above examples use simplified GET and HEAD requests. Most browsers send additional information to the server. While we can see the server's responses (as illustrated above) we can't see the actual request. However, an 'echo' server running on port 2020 on voyager was designed to simply echo back whatever it receives. Thus by typing the URL below into a browser, we can see exactly what how the browser forms its requests. Using Microsoft Internet Explorer (MSIE), issue a GET request for the following resource: http://voyager.cs.bgsu.edu:2020/index.html ========================================== List the HTTP request issued by MSIE verbatim. GET /index.html HTTP/1.1 Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */* Accept-Language: en-us Accept-Encoding: gzip, deflate User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322) Host: voyager.cs.bgsu.edu:2020 Connection: Keep-Alive What version of HTTP did MSIE use to formulate the request? 1.1 What is MSIE's user-agent string? Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322) ========================================== Repeat the above experiment for Netscape Navigator (NN). GET /index.html HTTP/1.0 Connection: Keep-Alive User-Agent: Mozilla/4.08 [en] (WinNT; I ;Nav) Host: voyager.cs.bgsu.edu:2020 Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */* Accept-Encoding: gzip Accept-Language: en Accept-Charset: iso-8859-1,*,utf-8 What version of HTTP did NN use to formulate the request? 1.0 (I used NN 4.08 found on browsers.evolt.org) What is NN's user-agent string? Mozilla/4.08 [en] (WinNT; I ;Nav) ========================================== POST Method Using the method described in Ch. 2 of Web Client Programming, issue a POST request for resource http://webapps.bgsu.edu/cgi-bin/bgsuform/test3 with the following entity-body: mailTo=gzimmer%40bgnet.bgsu.edu&mailFrom=gzimmer%40bgnet.bgsu.edu but replace my username with your username. List the exact POST request used to retrieve this resource. POST /cgi-bin/bgsuform/test3 HTTP/1.0 Referer: http://www.cs.bgsu.edu Connection: Keep-Alive User-Agent: Mozilla/3.0Gold (WinNT; I) Host: webapps.bgsu.edu Accept: */* Content-type: application/x-www-form-urlencoded Content-length: 65 mailTo=barstoc%40bgnet.bgsu.edu&mailFrom=barstoc%40bgnet.bgsu.edu List the exact response received from the server. HTTP/1.1 200 OK Date: Wed, 18 May 2005 16:56:08 GMT Server: Apache/1.3.26 (Unix) mod_jk mod_ssl/2.8.10 OpenSSL/0.9.7-beta3 PHP/4.2.3 Connection: close Content-Type: text/html
Thank you for using BGSU Forms!
The following information was submitted:
This is only a test!
client sent HTTP/1.1 request without hostname (see RFC2616 section 14.23): /hidd en.html
0 Connection closed by foreign host. >telnet www.bgsu.edu 80 Trying 129.1.2.175... Connected to www.bgsu.edu. Escape character is '^]'. HEAD /index.html HTTP/1.1 HTTP/1.1 400 Bad Request Date: Tue, 17 May 2005 17:19:47 GMT Server: Apache/1.3.28 (Unix) Connection: close Content-Type: text/html; charset=iso-8859-1 Connection closed by foreign host. > !t telnet www.bgsu.edu 80 Trying 129.1.2.175... Connected to www.bgsu.edu. Escape character is '^]'. HEAD /index.html HTTP/1.0 HTTP/1.1 403 Forbidden Date: Tue, 17 May 2005 17:08:00 GMT Server: Apache/1.3.28 (Unix) Connection: close Content-Type: text/html; charset=iso-8859-1 Connection closed by foreign host. > telnet www.ebay.com 80 Trying 66.135.208.89... Connected to hp-core.ebay.com. Escape character is '^]'. HEAD /index.html HTTP/1.1 HTTP/1.1 400 Bad Request Server: Microsoft-IIS/5.0 Date: Tue, 17 May 2005 17:10:29 GMT Connection: close Content-Length: 4009 Content-Type: text/html Connection closed by foreign host. > !t telnet www.ebay.com 80 Trying 66.135.208.89... Connected to hp-core.ebay.com. Escape character is '^]'. GET /index.html HTTP/1.1 HTTP/1.1 400 Bad Request Server: Microsoft-IIS/5.0 Date: Tue, 17 May 2005 17:12:09 GMT Connection: close Content-Length: 4009 Content-Type: text/html
The page cannot be found |
|
| The page you are look ing for might have been removed, had its name changed, or is temporarily unavail able. | |
|
Please try the following:
HTTP 400 - Bad Request
|