Explain HTTP ( Hyper Text transfer protocol )?
https://www.computersprofessor.com/2016/06/explain-http-hyper-text-transfer.html
The top layer in network protocol is application layer.
Logically data transfer happens b/w
applications and uses services from the other layers.
|
||||
The World Wide Web has its own special
protocol which applications like browser & web servers use to talk to
each other.
|
||||
HTTP is a protocol it is used
because of it is
|
||||
1)
Stateless
2)
Connectionless
|
||||
TCP – is session oriented.
|
||||
The
server & client maintain a connection for the duration of a data
exchange.
|
||||
HTTP – has no connect of session. i.e once a message
has been sent and received the two machines forgot a bout each other.
|
||||
Http
sessions
under
http there are four steps to communicating across the web.
1)
Make
the connection.
2)
Request a document
3)
Respond
to a request
4)
Close
the connection
Connection
setup:
The browser opens a standard TCP connect to the server.
|
||||
Port 80 is used by default but any
port which is not required by another application can be used.
Example: http://www.server.com:8080
|
||||
Browser
Request :
|
||||
Once the TCP connection is
established , the browser requests a given document using its URL.
|
||||
The command get tells the server ,
that the browser is attempting to retrieve a document
|
||||
The document is assumed to be stored
on the server and so the fully qualified address.
|
||||
Browsers can be send a variety of
other commands including post which sends from data to the server.
|
||||
Server
Response :
|
||||
The web- server process can
automatically insert information in to the header of a response.
|
||||
Content
– type : Tells the browser how to process the
document.
|
||||
Location
: Used to
automatically redirect the browser to another URL.
|
||||
Set
cookie : Set a Netscape cookie
|
||||
The server response begins with a
response code.
|
||||
Close
the Connection
:
The client and server can both close the connection.
|
||||
If another document is required a
new connection must be opened.
|
||||
Http error response codes (or) Error codes
|
||||
|