Understanding Http protocol

Http stands for hyper text transfer protocol. A browser is an HTTP client because it sends requests to an HTTP server (Web server), which then sends responses back to the client. The standard (and default) port for HTTP servers to listen on is 80, though they can use any port.

Here is basic steps how this works.

1) When client [most of the case web browser] get input URL it check for local DNS cache for respective IP for making connection.

2) If found, it goes to step 8

3) If not found It make a call to OS for DNS Lookup and get IP of the server mentioned for respective
URL.

4) Once IP found client stats making socket connection using TCP protocol.

5) Once connection is done, it sends request along with a request line header containing information about the request and request body.
     Request line contains Method, request URI, and http version.

6) Server receive the request packet process it and respond further to respective client.

7) Response contains status line, response headers and response body.

8) Browser tries to read the response and render it. If it can not render the request. It opens up a dialog box for a user to open response with suitable program.