HTTP stands for Hyper
Text Transfer protocol. Development of HTTP was initiated by Tim Berners-Lee.
It is application layer protocol which provide the communication between HTTP
client and HTTP server. HTTP protocol mainly used to access data on World Wide Web
(WWW).HTTP protocol use the services of TCP on port 80. HTTP is a protocol to
exchange or transfer of Hypertext. HTTP function is a combination of FTP (File
Transfer Protocol) and SMTP (Simple Mail Transfer Protocol). Basically, HTTP is
TCP/IP based communication protocol that is used to exchange the data on World
Wide Web. This is foundation of data communication for World Wide Web.
Standards development of HTTP was coordinated by Internet Engineering Task
Force (IETF). First version of HTTP was developed in 1991 which is HTTP/0.9.
Main function of HTTP is to transmit data across the internet.
Working of HTTP:
An “HTTP client”
is a program that establish a connection and send a request to “HTTP server”.
HTTP client and HTTP Server
An “HTTP server”
is also one type of program that accept a request and send response to “HTTP
Features of HTTP:
There are some basic feature are describe here.
Connectionless: The HTTP client initiates an HTTP
request, after a request is made it gets disconnected from the server and waits
for a response. The server gives the response to the request received and re-establishes
the connection with the client to send a response back.
Independent: Any type of data can be sent by HTTP
but both the client and the server should know how to handle the data content.
It is required by both to specify the content type using appropriate MIME-type.
Stateless: As HTTP is connectionless it can
directly considered as a stateless protocol. The server and client are aware of
each other only while they are doing transaction with each other. After that,
both of them has no knowledge about each other. Due to this, both client and
the server cannot gain information of each other during different requests
across the web pages.
Architecture of HTTP
HTTP protocol is based on a request/response model. The communication generally
takes place over a TCP/IP connection on the Internet. The default port is 80,
but other ports can be used. A requesting program (a client) establishes a
connection with a receiving program (a server) and sends a request to the server
in the form of a request method, URI, and protocol version, followed by a
message containing request modifiers, client information, and possible body
content. The server responds with a status line, including its protocol version
and a success or error code, followed by a message containing server
information, entity met information, and possible body content.
There are mainly two basic
methods of HTTP protocol.
In GET method only
limited amount of data can be sent, because data is sent in header.
GET method is not
secure in compare to POST method because data exposed in URL bar.
GET method is more
efficient and more used than POST method.
GET method can be
GET method is
idempotent. That means second request will be ignored until the response of
first request will be delivered.
GET method send up to
1024 character only.
GET method can’t be
send binary data, audio, video or any type of image file.
GET method is basically used for
retrieving the information or data from the server using URL.
Anatomy of GET Method:
In GET method, name and
value pairs are joined with equal sign and another pair of name and value are
joined with ampersand.
In POST method large
amount of data can be sent because data can be sent in body part.
POST method is more
secure than GET method because data can’t be exposed in URL.
POST method is less
efficient and less used than GET method.
POST method can’t be
POST method is
In POST method there is
no limit of data size to be sent.
In POST method we can
sent Binary and ASCII data.
POST method basically used
to send data or information on the server.
This method is almost similar to GET method but it does not return
the requested data. It is used to transfer header section, status line, server
response code etc.
HEAD is often used to check the following information:
Last-modified date of a document on the server for caching purpose.
Size of a document before downloading.
Type of requested Document.
HTTP REQUEST RESPONSE LINE:
Request structure of
used for retrieving the info. or data from the server
Used to send data or info.to the server.
should not return message body in the response. Transfer
status line and header section.
Connection establish between client and server.
URI stands for uniform resource indentifier.It is used to
identify name and resources on the internet.
URI consist 2 parts:
1)before the colon( : ) denotes schema(protocol).2) and
the part after colon depend upon the schema.
3) HTTP version:
define the version of http.
Request Header Filed:
request-header fields allow the client to pass additional information about the
request, and about the client itself, to the server. These fields act as
There are of some
important Request-header fields:
Example of Request Message:
GET /hello.htm HTTP/1.1
User-Agent: Mozilla/4.0 (compatible;
MSIE5.01; Windows NT)
Accept-Encoding: gzip, deflate
HTTP Response Structure from the Web Server:-