The Wayback Machine - https://web.archive.org/web/20090109154954/http://www.webreference.com/html/tutorial28/2.html


spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / experts / html / tutorials / 28 / 2

index123456

HTTP for HTML Authors, Part I

Developer News
Cisco Lawsuit: A Test for the GPL?
Shifts for Enterprise Linux, Green Networks in '09
Gifts for All in Linux 2.6.28

Fetch, boy! What browsers do with URLs

If you've read Tutorial 2, you should be well acquainted with URIs, and especially URLs. Here's a quick dissection of an http URL to refresh your memory:

Anatomy of an http URL
Anatomy of an http URL

Astute readers will note that the http bit means that this URL uses the http scheme. This governs how the rest of the URL is understood by a Web browser.

The server bit (webreference.com) and the port bit (80) tell the browser where to go looking for the Web site. The server denotes a computer connected to the Internet; the port denotes a sort of “socket” to which the browser plugs in to speak with the Web server.

The term “Web server” is often used to describe a computer that serves out Web pages, but is also used to describe a computer program that runs on a computer and serves out Web pages; this is how I'll use the term for the purposes of this tutorial. The person in charge of the computer runs this program, which then starts listening on a port for the first user to come a-browsing.

Using the, um, anatomically correct example above, a browser that would receive this URL (either because the user typed it into the Location field or because he clicked on a link) would run off to the computer called webreference.com, walk up to port 80 and knock politely. The Web server, which is running inside the computer, would open this port and look at the browser, with a look that suggests a strong “Whaddayawant”? kind of message.

The browser would then politely say something like the following:

GET /html/ HTTP/1.1
Host: webreference.com

This is HTTP-Speak for “Hello, I'd like to get the document called /html/ on your server. Oh, by the way, I'm fluent in version 1.1 of the HTTP protocol. And in case you're wondering, I came a-knocking for the host webreference.com; I hope this is it.” Most of this stuff is not of much importance to us HTML authors; the important bit is GET /html/. This is the main part of the HTTP request.

There are a few types of HTTP requests, but GET is by far the most common; it simply says “Give me this document.” We'll take a look at the second most common type of request, POST, later on.

The Host: webreference.com bit is an example of an HTTP header field. Headers are to HTTP requests what meta-information is to HTML; they're not critical, and most of the time they can just be omitted, but they can come in very, very handy. A header is always a name (in this case, Host), followed by a colon (:), followed by the header field's vallue (webreference.com). We'll talk more about headers later on.

index123456

Next Page...

http://www.internet.com/

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info

Copyright 2008 Jupitermedia Corporation All Rights Reserved.

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

webref The latest from WebReference.com Browse >
Overview of Popular JavaScript Frameworks - ASP.NET AJAX · An Introduction to 3D · Email Marketing Terms to Know
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Configuring Anonymous Dialog Security in SQL Server 2005 Express Service Broker Conversation · OpenVPN: Revoking Access and Expanding Management Options · Connecticut Town Lays Groundwork for Merged School, Municipal VoIP Network

URL: http://www.webreference.com/html/tutorial28/2.html

Produced by Stephanos Piperoglou
Created: January 15, 2001
Revised: January 16, 2001

Morty Proxy This is a proxified and sanitized view of the page, visit original site.