Skip to the content.

Web Fundamentals

Client and Servers

Client-Server Model The client-server model is a computing architecture that separates the functions of a computer program into two essential components: the client, which makes requests, and the server, which fulfills those requests.

Accessing Websites Uniform Resource Locator is used to access specific websites. It consists of various parts, including the transfer protocol (HTTP or HTTPS).

Request-Response Cycle:

Server Software Servers run specialized web service software (e.g., Apache, Nginx, Microsoft IIS) to handle HTTP requests from clients.

Handling Demand Popular websites, like Google.com, face high demand, requiring exceptionally powerful servers to manage the influx of requests. While any computer could be set up as a server, dedicated servers are often highly specialized for performance.

Key Differences

Importance for IT Professionals

URLs

Uniform Resource Locators (URLs) are essential for the web’s hypertext system.

URL Elements

Simplified URL Entry

HTTP URL Syntax

HTTP URL Components

Port Numbers Importance

Document Path The document path is the location of the resource in the web service directory.

HTTP and its Interactions

The client-server model is governed by the Hypertext Transfer Protocol (HTTP).

Despite simplicity for document requests, it poses challenges for identity-tracking applications. When accessing a website, the client sends a request to the server comprising:

The client will also send a mind type header and a message.

Client Requests

Essential Components of HTTP Client Requests

HTTP defines three common methods: GET, HEAD, and POST.

Understanding URIs:

URI Types:

Next up, the HTTP version. HTTP version numbers are made up of a major and a minor part.

Versions 1.1 and 2.0 are the most common versions at the moment.

Last up, we have MIME-like messages. This contains things like modifiers and forms data.

Server Response

Once a client makes an HTTP request to a server, that server will send an HTTP response.

First up, the server can either send a simple or a full response. A simple response happens when the server only supports HTTP 0.9 and would be a file or some data.

In a full response, for a server using HTTP 1.0 and above, the first line will always be a status line. The status line includes three things.

Full response:

Status codes:

The second part of a full response is the MIME-like message, which is generated by the server itself. This will have various header fields separated from the message body by a carriage return line feed, or CRLF, pair.

HTTP Header Information:

Message Body and MIME:

An example of this is creating new information in a database. It’s important to generate a valid MIME message as a response, complete with all the appropriate header fields.

MIME and HTTP

Originally designed for email and adapted for HTTP in web applications, MIME enables the sending of rich media, such as images and videos, through websites.

Resource Delivery in Web Applications:

MIME Features in HTTP:

MIME Message Components:

Content-Type Header Line:

Official Content Types:

Some of the most common types are application, or JSON, plain, or text, and image, maybe PNG, for instance.

Experimental content types are normally preceded by letters although as browsers and servers can negotiate acceptable types, this is not enforced.

MIME also allows the server to send multipart messages. The message body can contain multiple MIME messages, each with a header specifying the type of body data.

Understanding how a server responds is crucial for interpreting requests. Internal services may involve direct communication with the team or developer, while external services require knowledge of expected server responses for different requests.

HTTP Usage vs. Email

Header Fields in HTTP Submessages:

Example Scenario - File Upload:

Importance of Multipart Messages:

Security Issues and HTTPS

As the internet has matured, security has become a critical concern. The solution to combat data interception and reading is evident in the form of HTTPS. Without HTTPS, web applications relying solely on HTTP face the risk of exposing data easily over the internet

HTTPS encrypts the data at the source, which can only be decrypted using the encryption key.

This can only be decrypted with the use of the private key, which should be safely stored on the server.

Armed with this knowledge, HTTPS helps prevent against eavesdropping, fabrication, which is also known as the man in the middle attack, and impersonation.

Eavesdropping: Information transmitted over unknown and unaudited networks is susceptible to eavesdropping.

Modification or Fabrication: Imagine you’re trying to send a message to someone, but on the way it’s intercepted and changed. Even worse, imagine someone can fabricate a message to make it look like it’s come from you to take advantage of someone on your network.

Impersonation: Hackers can sometimes impersonate a system or use it to gain access to resources they aren’t actually entitled to.