|
It's
all about location, location, location
By
Brian Morgan and Dean Niquette
Skyline Technologies, Inc.
EDITOR'S NOTE: The first part of this
series ran in the November issue of Dot Com.
The
server.
TCP's shortcoming in terms of web communication is that
it does not impose any structure upon the data that it transmits.
In other words, TCP, working with IP, acts only as a messenger
service. In the World Wide Web, it is HyperText Transfer
Protocol (HTTP) that imposes structure.
An analogy should help clarify the role that each technology
plays: income is reported to the Internet Revenue Service
(IRS) using tax forms that are often carried through the
mail. In this scenario, the mail service plays the role
of TCP/IP and is responsible for reliably delivering forms
to the IRS. The forms, on the other hand, play the role
of HTTP and impose structure on the submitted information.
The fact that earnings are always reported in one box while
deductions are totaled in another makes it possible for
an IRS employee to accurately decipher the provided information.
HTTP imposes structure on web communication by defining
a "form" for requests and responses. The HTTP request form
is composed of a command, followed by one or more request
headers, and a request body. The HTTP response form, on
the other hand, consists of status code, followed by one
or more response headers, and a response body.
The two most common request commands are the GET and POST.
A browser issues a GET command to request a specific page
from a web server. For example, a browser could ask for
the page Contact.htm from the web server www.ST.com by issuing
an HTTP request. An HTTP POST, on the other hand, is used
to send information such as a user's name, address, and
credit card number to a web server, the submitted information
being carried in the HTTP request body.
The HTTP response, issued by the web server as a result
of an HTTP request, consists of a numeric status code indicating
whether the request was a success or failure along with
any HTML that may result. For example, in the case of a
successful HTTP GET, the response would return the requested
HTML document. For a failed HTTP request, the response will
often carry back HTML indicating the nature of the failure.
Common response codes include:
200 - Successful page request.
401 - The web user does not have adequate permissions for
this page.
404 - The server could not find the page requested.
The request and response headers provide another means for
a browser and web server to exchange information. For instance,
information on the type of browser being used can be communicated
to a web server in an HTTP "USER-AGENT" request header whereas
a "CONTENT-TYPE" response header can be used to inform the
browser that an HTML file is being returned.
In addition, cookies, or morsels of web server data stored
on a browser, are exchanged through HTTP headers. A web
server places a cookie on a browser using an "SET-COOKIE"
response header and then, on ensuing page requests, the
browser provides that cookie back to the web server via
the "COOKIE" request header.
HyperText
Markup Language (HTML)
Web sites
would be boring if browsers only displayed text in a single
font and size. Images, audio, differing fonts, and color bring
web sites to life. It is HyperText Markup Language (HTML)
that makes this creativity possible .
An HTML file is simply a text document that is "marked-up"
with "tags" that indicate, to a browser, how the text should
be displayed, where and what images should be included, etc.
This framework originates from the world of printed media
in which editors "marked-up" text to indicate, to their printers,
how content should appear.
Let's see how this works with HTML. Assume we want to display
the following text:
Associate Information
Brian Morgan (this line is in blue) Skyline Technologies,
Inc.
To do this we simply mark-up the original text with HTML tags
.
<b>Associate Information</b><br> <font>Brian
Morgan</font><br> Skyline Technologies, Inc.<br>
Most HTML tags come in pairs; a start tag having the form
<tag> begins markup while an end tag of the form </tag>
completes the markup. In the above HTML the <b></b>
tag pair is used to mark "Associate Information" as bold while
the <font></font> tag pair indicates to the browser
that the enclosed information should be displayed in blue.
The single tag <br> tells the browser to start the ensuing
text on a new line.
The authors are from Skyline Technologies and can be reached
via e-mail at [email protected]
and [email protected]
|