HTTP
Home Back Course Listing Connect Glossary About Us/Credits

 

Back

Sign up for the Newsletter here!

For anyone interested in how the Internet really ticks, http is one of the most important thing you can learn.  Most people only know that http is the item that you put before the www. in an web address. But just about everybody has had more experience than they know with http. Have you ever gotten a 404 File Not Found Error? That's an http error message.  This course will teach you all about http. After reading it, the internet will truly make sense.

Http stands for Hyper Text Transfer Protocol, which is the way servers and computers communicate to transfer documents and files.

There are a couple of new terms you should know before you read the rest of this course. One of these is the "client", the computer that is receiving the information. The computer that is supplying the information is known as the "server". The communication between these two systems is the basis of the Internet.

When you type in http:// in front of your web address, you are telling the browser to use http to communicate with the server that is hosting the site www.the_address. The first thing your computer will do is send a message to the server that tells it what document or file it wishes to receive. In coding, it looks like this:  

GET /the_file.html HTTP/1.1

This method of receiving information is called the GET method, and is the most standard way of HTTP communication. The_file is the requested file, and HTTP/1.1 shows the version of HTTP the client is using.

The client then sends information to the server regarding what software platforms it uses, and what types of images in prefers. In coding, this step look like this:

User-Agent: Mozilla/4.05 (Win98)

Accept: image/png, image/gif, image/jpeg */*

The user agent is the type of browser used, and the Win98 stands for Windows, the 1998 Version. The client also tells that it accepts .png files, gif, and jpeg files.  A blank line shows that the message is over. This information is known as the header.

The client may also send another message sending information that was gathered from a cgi-script, such as form data.

The server will then respond to the clients message, which contain three parts and looks like this:

HTTP/1.1 200 OK

The first part, HTTP/1.1 shows that the server also uses HTTP version 1.1. The 200 is a code message meaning that the file is available and will be sent. OK is just a message that is in English so that it can be read and understood.

It is important to realize that the server does not only generate 200 codes.  There are many different numbered codes, and we will explain them below.

If the number is between 100-199, it means that the message is just informational.  Between 200-299 means that the request was sucessful, 300-399 means that it was not sucessful but will be with further action. 400-499 means that the request did not work properly, and 500-599 are internal server errors.

The most commonly known one of these error messages are 404 File Not Found Errors.  These are generated when the file you are looking for is not on the server. If you have never seen one of these, open up a new window in your browser and type in (or follow this link) /C0110523/whatever

There is no such file on the TQ server, and you will receive a 404 File Not Found Error.

We will assume that the file was on the server, and that the server has located it, generation g a 200 code. The server will now send header information like this:

Date: Sat, 10 Oct 2010  09:32:12 GMT

Server: NCSA/1.5.2

Last Modified: Fri, 9 Oct 2010  09:32:12 GMT

Content type: text/html

Content-length: 54659

The date is the current date, the server is the software the server is running, and the date last modified is when the file was last changed. The content type is the type of file that the server is sending to the client, and its length is in bytes (making this file 54.659 kb).

The server will then send a blank line signaling an end to the communication, and then send the requested information. In HTTP 1.0, the server automatically disconnects, but in 1.1 it stays connected.  Do you know, each time you http, the server and client must go through the whole process from the beginning. It will not remember the information it was given by the client after it has finished the transfer.

There are two other http methods that are commonly done in http 1.1. One of these is the HEAD method.  This is the same as the GET method except for the fact that no data is being sent; the client just wants the servers statistics and the statistics of the document. 

The third is the POST method, where the client sends the server information that the server requested. This is sometimes done with cgi-scripts. The client sends whatever the user has entered into the form.

There are seven other methods, but are used rarely. They are: Link, Unlink, Put, Delete, Options, Trace, and Connect.

That should give you a good base for understanding HTTP, and there are many other aspects of the protocol that you can read about at w3.org

 

Back to Top of Page.

<espaņol> <french> <hebrew> <german> <russian> <italian> <portuguese> <arabic> <japaneese> <chinese> <korean>                                                                                  

 

Copyright Thinkquest Team C0110523: Jordan, Maegan, and Chris. Please contact us if you wish to use any part of this website Visit Thinkquest at thinkquest.org

Click Here to Sign our Guestbook!