The GET Method
The GET Method
-
The foundation of HTTP/0.9 (the first implementation of the HTTP protocol)
was the definition of the GET method that was used by a web browser to
request a specific document.
-
For example, the following HTTP request would return the document "index.html"
that was located in the web server's root directory called "webdocs"
GET /webdocs/index.html CRLF
-
Notice that the GET request began with the GET keyword, included a document
to retrieve, and ended with a carriage return and line feed combination.
-
If you would like, you can try making a GET request by connecting to your
favorite web server and sending the GET request yourself (as if you were
a web browser).
-
Below is a GET session I cut and pasted from a telnet window. In this case,
I used telnet to contact the web server "www.extropia.com" and asked for
the file "irobot.html" in the "Scripts/Columns" directory (Don't forget
the carriage return and line feed at the end, ie. hit Enter or Return).
The server responded by sending me the contents of that file (the HTML
code you see). You can also see a screen
shot of the session.
selena: telnet www.extropia.com 80
Trying 206.53.239.130...
Connected to www.extropia.com.
Escape character is '^]'.
GET /Scripts/Columns/irobot.html
<HTML>
<HEAD>
<TITLE>Hello there</TITLE>
</HEAD>
<BODY>
Hello there. My, you are awfully good-looking to be a web
browser!
</BODY>
</HTML>
Connection closed by foreign host.
selena:
-
The beauty of web browsers of course, is that they take care of the HTTP
protocol specifications so that the user only needs to enter the URL of
the page they want to see. The web browser formulates the actual GET request,
sends it to the web server, receives the HTML document back, and then displays
the HTML document according to the HTML instructions.
Sending
User Defined Input to a Web Server
Table of Contents
Exercise One
|