The World Wide Web (WWW) is a vast collection of interlinked hypertext documents, multimedia content, and applications that are accessible through the internet.
- The WWW is often referred to as just the “Web,”.
- The Web allows users to navigate and access information via browsers using Uniform Resource Locators (URLs), essentially providing an interface for browsing and interacting with digital content.
- The WWW was developed in 1989 by Tim Berners-Lee at CERN (European Organization for Nuclear Research) to enable easy access to shared documents over the internet, and it quickly grew to be the dominant way of accessing information online.
Working of the WWW
The World Wide Web operates on a client-server model. The process involves various steps, including:
- Client Request: When a user enters a URL in a web browser, the browser sends a request to a web server to access a specific page or resource.
- Server Response: The server processes the request and sends back the requested data in the form of HTML, CSS, JavaScript, and media files.
- Rendering: The browser interprets the response (HTML, images, videos, etc.) and displays it as a web page to the user.
- Navigation: Users can then interact with the page through hyperlinks, allowing them to move from one page to another within the web.
HTTP Request and Response
HTTP is the protocol used for transferring data over the web. It defines how requests and responses between the client (browser) and the server should be structured.
HTTP Request
An HTTP Request is initiated by the client (usually a web browser) when it wants to access a resource (such as a webpage).
It consists of several key components:
- Request Line: This includes the method (e.g., GET, POST), the URL, and the HTTP version (e.g., HTTP/1.1).
- Example:
GET /index.html HTTP/1.1
- Example:
- Headers: Metadata about the request, such as browser type (User-Agent), content types, and authorization details.
- Example:
User-Agent: Mozilla/5.0 or Accept: text/html
- Example:
- Body (Optional): In some cases, especially for POST requests, the request may contain data sent to the server, such as form data.
HTTP Response
An HTTP Response is sent by the server back to the client. It contains the data requested, along with status codes indicating whether the request was successful or if there was an error.
Key components include:
- Status Line: Contains the HTTP version, status code, and a short message describing the status.
- Example:
HTTP/1.1 200 OK
(indicating the request was successful)
- Example:
- Headers: Like the request headers, these provide additional information about the response, such as content type and length.
- Example:
Content-Type: text/html
- Example:
- Body: This contains the content that the server sends back, such as HTML, CSS, images, or other resources. It forms the core of the web page being displayed.