To Documents
Using HTTP for Client-to-server Communication
- HTTP means Hypertext Transfer Protocol.
- HTTP/0.9 was introduced in the early 1990s. It was designed to request
hypertext (no images or other multimedia) pages from a server.
- HTTP/1.0 was introduced in May 1996. It could handle not only simple
text documents, but a wide variety of file formats using the
Multipurpose Internet Mail Extentions (MIME) standard.
- The current version of HTTP is 1.1.
- An HTTP request looks like this:
GET / HTTP
followed by a blank line.
This means get the default file in the home directory.
- The CDM ectweb2 server looks for the default document in this order:
index.html, index.htm, index.asp, default.html, default.htm, default.asp
- If you are working on Windows XP, the telnet client should be enabled
by default.
- If you are working on Windows7, enable the telnet client as follows:
- Select Start >> Control Panel >> Programs and Features >>
Turn Windows features on and off.
- Check Telnet Client.
- Click OK.
- Now try typing the following line in a command window:
telnet condor.depaul.edu 80
(The port number is 80 for telnet.)
Then type the following HTTP command (not echoed so type carefully):
GET /sjost/ HTTP
followed by a blank line.
- HTTP then displays the following header followed by the HTML code for the
requested page:
HTTP/1.1 302 Found
Date: Thu, 27 Apr 2006 02:50:55 GMT
Server: Apache/2.0.53 HP-UX-Apache-based_Web_Server (Unix) PHP/4.3.8
Last-Modified: Sun, 02 Apr 2006 20:09:32 GMT
ETag: "16896-61d-408dd700"
Accept-Ranges:Bytes
Content-Length: 1565
Connection: close
Content-Type: text/html
HTML code follows ...
- One can request only the header, for testing purposes,
with this HTTP command:
HEAD /sjost/ HTTP
- Here are the eight HTTP request methods:
GET Requests a specified document. A header is returned
with document meta-information followed by the actual document.
This is the most commonly used HTTP command.
HEAD Asks for the header that would be sent in response to
a GET request, but without the document. Used for testing.
POST Submits user data (often user supplied data on an HTML
form) to be processed by the server.
PUT Uploads the specified file.
DELETE Deletes a file on the server (rairly used).
TRACE Echoes back the specified request so the client can
see what intermediate servers are adding or removing from the request.
OPTIONS Returns the HTTP methods that the server supports.
Used for testing.
CONNECT Used to connect to a proxy that can change to being
an SSL (Secure Socket Layers) tunnel.
- Check out the Wikipedia article on
Hypertext Transfer Protocol for more details.