December 10

What exactly happens when we type in a URL on browser to when a page loads?

  1. Enter “facebook.com” into the address bar.
  2. Browser resolves this to the numeric IP address.
  3. Browser issues a “HTTP/GET” request. It passes along an HttpRequest which includes metadata about the browser, user preferences like preferred language and any stored cookies for that domain.
  4. Facebook servers receive the request and their code begins to craft a response.
    • Facebook will use the passed information including cookies to determine who the user is and what information to send back
  5. A HTTP Response is returned from Facebook including a status line (200 OK, etc). Headers which include content-type, etc and the HTML body.
  6. The browser receives the Response and begins to parse it for display.
    • The HTML body will include links to CSS, JS and images.
  7. The browser layout engine will start to assemble the final page for display.
    • CSS information may alter the layout and look of the page
    • JS and DHTML may alter the layout of the page
  8. The final page is assembled and rendered to the end user.
November 14

HTTP(Hypertext Transfer Protocol) Request and Response

http

HTTP protocol works in a client and server model. A web browser using which a request is initiated is called as a client and a web server software which respond’s to that request is called as a server.

Below mentioned are some key points & terms to note about HTTP protocol,

  • HTTP is an application layer protocol
  • The default port if not mentioned in the request, is assumed as 80
  • The hostname in the request is case insensitive
  • World Wide Web Consortium and the Internet Engineering Task Force, both coordinates in the standardization of the HTTP protocol
  • HTTP allows the improvement of its request and response with the help of intermediates in between(for example a gateway, a proxy, or a tunnel)
  • The resources that can be requested by using HTTP protocol is made available with the help of a type of URI(Uniform Resource Identifier) called URL(Uniform Resource Locator).
  • TCP (Transmission Control Protocol), is used to establish a connection to the application layer port 80 used by HTTP.(its not at all necessary to use port 80 for http connections, but if not explicitly mentioned in the URL, port 80 is assumed)
  • A series of request and response in http is called as a session in HTTP
  • HTTP version 0.9 was the first documented version of HTTP
  • HTTP is a stateless protocol(which means each and every connection is independant of each other.)
Category: HTTP | LEAVE A COMMENT