JavaScript and JSON Essentials
上QQ阅读APP看书,第一时间看更新

Basic web operations

When a user opens up a web browser and types any URL – for example, http://www.packtpub.com/ – the following sequence of activities takes place :

  1. The browser makes a request to the Internet Service Provider (ISP) to perform
    a reverse lookup of the IP address by providing the domain name.
  1. Once the IP address is retrieved, the request is then forwarded to the machine that owns the IP address. At that point, there is a web server that is waiting to consume the request; the web server could be one of the top web servers, such as Apache, IIS, Tomcat, and Nginx.
  2. The web server receives the request and looks at the headers that are part of the HTTP request; those headers pass the information about the request that was made to the web server.
  3. Once the web server parses those headers, it routes the request over to a server-side programming application that is responsible for handling this request. The application could be written in PHP, C#/ASP.NET, Java/JSP, and so on.
  4. This responsible server-side language takes the request, understands it, and performs the necessary business logic to complete the request. A few examples of such HTTP requests are loading a web page and clicking the Contact us link on a website. There can be complex HTTP requests too, where the data has to be validated, cleansed, and/or retrieved from a data storage application such as a database, a file server, or a caching server.