ironbark. It builds on the examples in the previous prac exercises.
First using your Web browser, attempt to open the URL
student. Type this string into each of the username and password boxes and click the "OK" button, or whatever your browser calls it. It works? Good.
ironbarkat port 80. Then copy and paste the following HTTP request, terminated as usual by two newlines:
Scroll back up the page to view the HTTP headers. You should see an error message like "
GET /subjects/int21cn/test/index.html HTTP/1.0
HTTP/1.1 401 Authorization Required". This means, of course, that to retrieve the page you will need to submit a valid
This means that when the string
> mimeencode student:student c3R1ZGVudDpzdHVkZW50
student:studentis Base-64 encoded, the result is
c3R1ZGVudDpzdHVkZW50. So now we can create a new HTTP request. Once again, telnet to
ironbarkat port 80, and then send the following HTTP request (remember 2 newlines):
Does it work? It should, it did for me.
GET /subjects/int21cn/test/index.html HTTP/1.0 Authorization: Basic c3R1ZGVudDpzdHVkZW50
telnetto fetch Web pages by typing in the bare HTTP commands. Our Unix systems provide three command-line utilities called
POST(note uppercase) that we can use to exercise these protocol methods. So, for example, we could type, at the Unix command prompt:
This shows both the command typed, and the first few lines of the data returned from the server. The commandline options
> GET http://ironbark.bendigo.latrobe.edu.au/ 200 OK Connection: close Date: Tue, 16 Mar 2004 11:14:13 GMT Accept-Ranges: bytes ETag: "89df2c-1f78-3e2de49a" Server: Apache/1.2.6 Content-Length: 8056 Content-Type: text/html Content-Type: text/html; charset=iso-8859-1 Last-Modified: Mon, 2 Feb 2004 00:23:54 GMT Client-Date: Tue, 16 Mar 2004 11:14:18 GMT Client-Response-Num: 1 Title: The Department of Information Technology at La Trobe University, Bendigo X-Meta-Description: Department of Information Technology Home Page <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> <HTML> <HEAD> ...etc...
GETprogram to print the protocol status lines and the response headers. Note that we didn't have to
telnetto ironbark at port 80 -- the
GETutility looked after all that for us. In fact, we could consider
GETas a command-line Web browser...
:-). You can, of course, substitute the word
HEADand see just the reponse headers, without the need for any commandline options and without the annoyance of having to scroll all the way back to the start to view them.
Set-cookie:header. Interesting, huh?
GETa URL which has the URL-encoded FORM data appended to the URL, exactly as described. For the
PUTrequest you have to key (or paste) in the URL-encoded data.