Electric Type

Multimedia

About Us

News

Help

HTTP Transactions and You
by Dean Gaudet 14 Feb 1997

Dean Gaudet is a native of Canada, a former Wired Digital network guru, and a core developer on the Apache Web Server. We try not to laugh when he pronounces "router" like "rooter."

Page 1

Q:   What really happens when you click on a link?
- Chuck


A:   Web browsers use a graphical user interface (GUI) to open connections and request pages, so you normally don't see what's really taking place. When you click on a link, the first thing your browser does is find the IP address of the site where the page you want to look at is located. If you've ever punched in a URL and received a "Server does not have a DNS entry" dialog box, you're probably familiar with this process, but if you'd like to learn more, check out Kristin's column on the Domain Name System.

Once the server's IP address is located, your browser (the client) returns its own address and a TCP connection is opened. I'll explain more about TCP in a minute. For now, you only need to know that TCP stands for transport control protocol, and it's what holds the Net together.

Now that we've established a connection, your request can be sent. But what does this "request" look like? Let's pretend you're clicking on a link to www.grippy.org/mattmarg/ from www.aleeanne.org.uk. When you do this, your browser makes a request that looks something like this:


Get /mattmarg/ HTTP/1.0

User-Agent: Mozilla/2.0 (Macintosh; I; PPC)

Accept: text/html; */*

Cookie: name = value

Referer: http://www.aleeanne.org.uk/html/96/47/index2a.html 

Host: www.grippy.org

The first line is called the request. It's saying, "Get the default file from the directory called mattmarg." If you typed in the URL without the closing slash, as many people do, you'd get a redirect response, which means the server would tell the client that you really want the slash even though you didn't say so.

The subsequent lines in the above example are request headers that provide more detail about the request. Let's take a look at them:

  • The User-Agent tells which browser you're using. In this case, it's Mozilla 2.0. The platform, Macintosh; I; PPC, is listed here as well.

  • The next line is the Accept header, which defines what type of data the browser can handle from the server. In this case, Mozilla 2.0 can handle text/html as well as all the other various MIME types (for things like images, plug-ins, and VRML).

  • If you've visited this site before, the server may have sent you a cookie. If you have one, your browser sends it back now with the cookie's name and value.

  • The Referer header tells the server the page you were on when you clicked on the link. You might also notice that the engineers who coined the term Referer didn't win any spelling bees in elementary school.

  • The Host header displays the hostname portion of the URL you requested. In this case, it's www.grippy.org.

There are some other headers that can also appear here. A couple of the more common ones are Expires and If-Modified-Since. The first prevents access to a page or image after a specific date. The second tells the server to send the most recent version of a page if it's been modified.

next page»


Tutorials  

User Blogs  

Teaching Tools  

Authoring  

Design  

Programming help  

Advanced Flash  

Javascript  

Glossary  

PHP Coding  

User Blogs

Screen Shots

Latest Updates

Contact Us

Valid HTML 4.01!
Valid CSS!

Breadcrumb

© ElectricType
Maintained by My-Hosts.com
Site map | Copyright | Disclaimer
Privacy policy | Acceptable Use Policy
Legal information.