Web Applications
In a Nutshell - CIW Course Section 3, Part B2, Chapter 1
HTTP Messages
HTTP messages are composed of HTTP requests and HTTP replies.
A request is sent by a client and consists of a command and optional headers and body.
| GET / HTTP/1.1 Host: www.ciwcourse.co.uk Connection: close Accept-Encoding: gzip Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/msword, application/x-shockwave-flash, */* Accept-Language: en-gb User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) Web-Sniffer/1.0.23 Referer: http://web-sniffer.net/ |
The above example is the HTTP request for the home page of this site. The first line is the command and the remaining lines are the headers. Note: the line ending */* has wrapped but in the header it is all one line.
| HTTP Status Code: HTTP/1.1 200 OK Server: Zeus/4.3 Date: Fri, 23 Dec 2005 09:04:12 GMT Last-Modified: Mon, 30 May 2005 19:20:35 GMT Vary: Accept-Encoding Content-Type: text/html Content-Length: 2856 Accept-Ranges: bytes Content-Encoding: gzip Connection: close Set-Cookie: X-Zeus-Mapping-3ade68de=mercury.hosts.co.uk; path=/ |
Above is the corresponding reply. A reply consists of a status message, headers and body. From the 1st line it can be seen that this page was retrieved successfully as the status is 200. The 2nd line identifies the server type, which surprises me as I thought my host ran Apache. The final line contains a reference to the actual host machine.
| HTTP Request Commands | |
|---|---|
| OPTIONS | Inquires about options available on the server |
| GET | Retrieves specified resource |
| HEAD | Retrieves headers only, for the specified resource |
| POST | Passes body to resource for further action |
| PUT | Stores body in location specified by resource |
| DELETE | deletes resource |
| TRACE | Echoes outgoing message back to sender |
Most of us will be familiar with the status message 404 - Page Not Found but, there are many possible status messages.
| HTTP Reply Status Codes | |
|---|---|
| 1xx | The request was received, this is a continuing process |
| 2xx | The action was successfully received, understood and accepted |
| 3xx | Further action must be taken to complete the request |
| 4xx | The request contains incorrect syntax or cannot be fulfilled |
| 5xx | The server failed to fulfil a valid request |
Editing HTTP Error Messages
Error messages originate from the Web Server, so editing the messages can only be done by someone with access to the server.
Each error has an associated html file as you can see from the above image. So, editing the error message is as simple as editing the target file.
Web Applications and E-Commerce
Web applications process information sent from an HTML form on a Web browser to a server.
Features of Web Applications:
- Process information sent from an HTML form
- Count hits to a page
- Generate dynamic HTML quickly
- Enable a Web site to communicate with a database
- Facilitate e-commerce
Client-side applications are downloaded by the client from the server and executed by the client's system.
Server-side applications reside on the server itself and are executed by the server. Examples of application servers may include: Allaire ColdFusion, Microsoft Transaction Server, and Microsoft IIS 5.0 Active Server Pages engine.
A Web server identifies that a URL refers to a script in one of two ways. If the file is in a nominated script directory or if the Multipurpose Internet Mail Extensions (MIME) identify it as a script.
MIME
Multipurpose Internet Mail Extensions (MIME) are used to classify documents in order that they may be associated with the correct application or add-in.
To locate MIME settings in Windows 2000, open "My Computer" and click Tools | Folder Options, then click the "File Types" tab.
In Netscape Navigator from the preferences window, click "Helper Applications" and the file type will be listed in the right-hand pane. On my installation of Navigator, this file list is empty, but plug-ins still seem to work. I am using Navigator v7.1.
