Newsflash

Publishing your articles and thoughts online was never so easy, Career discussions is looking for writers to contribute to our online content.
 

Home arrow News arrow Latest arrow Data on the Web
Data on the Web Print E-mail
Written by Abhi   
Sunday, 16 March 2008

A Web client program (such as a web browser) can access data from many different servers, such as Gopher, FTP, NNTP (Usenet) or HTTP. The HTTP server was designed specifically for the Web, and employs a protocol (system of messages) that supports sending documents from the server to a browser, and that also support sending complex data from the client back to the server.

 Gopher is a distributed document search and retrieval network protocol designed for the Internet. Its goal is to function as an improved form of Anonymous FTP, enhanced with hyperlinking features similar to that of the World Wide Web.

 

The Network News Transfer Protocol or NNTP is an Internet application protocol used primarily for reading and posting Usenet articles (aka netnews), as well as transferring news among news servers.

 Usenet (a contraction of user network) is a global, decentralized, distributed Internet discussion system that evolved from a general purpose UUCP architecture of the same name.

 Usenet was originally designed around the UUCP network, with most article transfers taking place over direct computer-to-computer telephone links. Readers and posters would log into the same computers that hosted the servers, reading the articles directly from the local disk.

 UUCP stands for Unix to Unix CoPy. The term generally refers to a suite of computer programs and protocols allowing remote execution of commands and transfer of files, email and netnews between computers. Specifically, uucp is one of the programs in the suite; it provides a user interface for requesting file copy operations. The UUCP suite also includes uux (user interface for remote command execution), uucico (communication program), uustat (reports statistics on recent activity), uuxqt (execute commands sent from remote machines), and uuname (reports the uucp name of the local system).

 
There are several HTTP methods for sending complex data from the client back to the server.
(in HTTP, methods is a technical term for the way in which data are sent between a client browser and server).

The most common methods are

 GET

  • The data are passed within the query string of the URL.
    For example, accessing the URL
    http://www.somewhere.org/data/pgm?query_string
    sends the data included in query_string to the HTTP server running on the machine www.somewhere.org
  • Can only send limited amount of data

POST

  • The data are sent as a message body that follows the request message sent by the client to the server. This is more complex than GET, but allows for more complex data.
  • Can send any amount of data

Sending data to the server is one thing, but in most cases the server cannot itself process the data -- most HTTP server program are designed only to serve out documents, and are not designed to process data sent from a client. Therefore, if you want to do server-side processing of the data sent from a fill-in HTML FORM (or by any other mechanism), you need three things:

  • a second program to do process the data sent by the client,
  • a mechanism by which the server can forward the data to this second program. Such secondary programs are called gateway programs, because they act as a gateway between the Web and other resources on the HTTP server machine, such as databases
  • a way whereby this second program can return data to the client, so that  teh gateway program can return results of its analysis to the user.


Common Gateway Interface


The arrows in the figure ( CGI ) show the flow of data, while the small ovals straddling the lines show the protocols and mechanisms by which the data are communicated from client(browser)-to-server-to-gateway and back again.

The Figure illustrates the flow of data when a user accesses a CGI program. The solid line shows to data flow using HTTP and CGI. HTTP transfers data from the client to the HTTP server, and back again. The CGI mechanisms control the flow of data from the server to the gateway program (shown as the prism) and back again. These are called gateway programs because they generally act as gateways between the World Wide Web and server-side resources such as databases, feedback forms, clickable imagemaps, and so on

CGI (Common Gateway Interface) is the generic interface between the server and server-side 'gateway' programs. CGI specifies how data are sent to the gateway program, and how data can be returned by the gateway program, through the server and back to the browser that originally sent the data

The basic mechanisms are:

Sending Data to the Gateway Program

The CGI specifies how data are sent to the gateway program (as environment variables or as data read, by the gateway program, from standard input) and what data are sent (in general, all the data sent by the client to the server, plus extra environment variables describing the status of the server).

 Returning Data to the Client

To return data back to the client program (the user's web browsers) the gateway program just writes data to it's regular (standard) output. These data are sent back the the client, after some processing by the server to ensure they have the correct message headers describing the data and the state of the transaction. 

Of special note is the fact that the gateway program must write to standard output, before anything else, header messages explaining the MIME type of the data being returned by the program -- this is the only way that the server can know what type of data are being returned by the gateway program. Thus the gateway program must, at the very list, print out a a two- line header (the second of which must be a blank line):

                Content-type: text / html   The  appropriate  content-type header
                  ( A blank line separates the header from the data)
                   data   ...    The data being returned

                                                                                                                                           ...  to be continued

 

Last Updated ( Monday, 17 March 2008 )
 
Next >
© 2010 Careerdiscussions.com
All content Copyright (C) @ CareerDiscussions.com and its authors, reproduction without prior consent prohibited