Monday, January 31, 2011
HTTP (Hypertext Transfer Protocol)
How can two computers share data?
What sets the connection between two computers on a network?
What is the actual form of the data sent over the Internet?
A computer network is a collection of two or more computers linked together for the purposes of sharing information, resources, among other things. The Internet, for example, is a global system of interconnected computer networks. While surfing the net, your computer sends and receive data over the internet two and from other computers.
Just like humans, two computers need a common "language" to talk to each other, a form of predefined rules to send and receive data. The protocol in which two computers are "speaking" is call The Internet Protocol (or IP).
Information is sent over the internet (using the IP) has the form of "Packets" - a basic transfer unit consists of header and data areas, where the header contains information about the sender and the destination computer and the data field contains the information to deliver.
As you see, beside the data, the protocol contains more information. Most of the other information describes the data so the receiver will "know" how to handle the content it gets.
IP uses its application layer protocols for describing the content. Lots of transformation protocol exist, for example the File Transfer Protocol (FTP) is a standard network protocol used to transfer files from one host to another over a network. The most used protocol over the internet is the HTTP protocol.
HTTP - Hypertext Transfer Protocol
HTTP functions as a request-response protocol in the client-server computing model. A typical "conversation" using this protocol evolved a web browser that acts as the client, while an application running on a computer hosting a web site functions as a server. The client submits an HTTP request message to the server. The server, which stores content, or provides resources, such as HTML files, or performs other functions on behalf of the client.
Example Request:
GET [ the path to the content - a URI] HTTP/1.1
HOST: [the server domain]
Connection: keep-alive
Referrer: [the caller - that initiated the HTTP call]
* This kind of HTTP call will find its way to the requested server that suppose to return the requested data. The response, of course, also has predefined format.
Example Response:
HTTP/1.1 200 OK -- the status of the response
Date: [the response date time]
Cache-Control: [the cache period of the returned data]
Server: [the server name - like: Microsoft-IIS/7.0]
Connection: close -- Indicates that the TCP connection closed
Connection-Length: [the length of the returned data - in bytes]
Content-Type: [html, script, xml etc.]
Response Data:
HTML, Javascript, JSON etc.
So, (and maybe the most important part :) ) - when you write an HTTP address i the address bar, like http://www.challengenes.com, you ask a server to give you the information this address contains. The information in this case has the form of HTML, those, the browser draws it inside your browser screen.
Enjoy.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment