You are on page 1of 25

+

Internet Programming 1
Chapter 1:
HTTP- the Hyper-Text Transfer Protocol
Mohamed Mahdi
+ 2

Content

1. Introduction

2. The World wide Web (WWW)

3. The domain name system

4. URL, URI, URN

5. HTTP request response, the stateless nature of HTTP

6. Web browser

7. HTTP Authentications
+ 3

Introduction

 HTTP was developed by Sir Tim Berners-Lee in the early 1990s while working at CERN, the
European Organization for Nuclear Research.
 It was created to facilitate the sharing of documents among scientists.

 HTTP, or the Hyper-Text Transfer Protocol is a protocol that enables the transfer of hypertext
and other data on the internet.

 It is the backbone of web communication, allowing web browsers to request and display web
pages, images, videos, and other resources.
+ 4

Introduction

 Hypertext: HTTP is specifically designed for transferring hypertext, which includes text, links,
and media like images, audio, and videos. These elements collectively make up web pages,
which are the building blocks of the World Wide Web.
+ 5

The World wide Web (WWW)

 It was invented by British computer scientist


Tim Berners-Lee in 1989 while working at CERN
in Switzerland.

 The World Wide Web, commonly known as


WWW or simply the web, is a system of
interlinked hypertext documents accessed
through the Internet.

 The web has since become an integral part of


modern life, with billions of users accessing it
every day for a wide range of purposes.
+ 6

The World wide Web (WWW)

 The web is based on the concept of hypertext, which allows users to navigate between
different pieces of content by clicking on links.

 The web is accessed through web browsers, which interpret the HTML and CSS code used to
create web pages and display them to users.

 The web is constantly evolving, with new technologies and standards being developed to
improve its functionality and security.
+ 7

The World wide Web (WWW)

 The World Wide Web (or web, for short) is a global digital library of information available
to anyone connected to the Internet

 The web consists of a worldwide collection of electronic documents, each of which is called a
webpage
 A website is a collection of related webpages

 A web server is a computer that delivers requested webpages to your computer


+ 8

DNS
+ 9

The domain name system

 The Domain Name System (DNS) is a


hierarchical naming system that translates
domain names to IP addresses.

 It enables users to access websites using


easy-to-remember domain names instead
of complex numerical IP addresses.
+ 10

The domain name system

 Hierarchy and Structure:


 Root Domain: The highest level of the DNS hierarchy, denoted by a dot (.). It doesn't
appear in typical domain names but is implied at the end of all domain hierarchies.
 Top-Level Domains (TLDs): Directly under the root, these include generic TLDs
(e.g., .com, .org) and country-code TLDs (e.g., .us, .uk).
 Second-Level Domains: Situated below TLDs, they are often specific to countries,
organizations, or purposes (e.g., example.com).
 Subdomains: Further subdivisions under second-level domains, enabling organization
and categorization (e.g., mail.example.com).
+ 11

URI, URL, URN

 A URI (Uniform Resource Identifier) is a


string of characters used to identify or locate a
resource (or both) such as a document, image,
or any other item, on the internet.

 URIs are further divided into two subcategories:


URLs and URNs.
+ 12

URI, URL, URN

 A URL (Uniform Resource Locator) is a link or web address used to identify and locate
specific webpage, file, or resource on the internet.

 They allow users to navigate the web and retrieve specific content from servers.

 Its essential elements include:


+ 13

URI, URL, URN

 Let's break down the components of a URL:


 Protocol: defines the rules and methods for communication between the client and server. Common protocols include
HTTP, HTTPS, and FTP.

 Domain Name: identifies the specific website or server where the resource is hosted. It typically consists of a
combination of a second-level domain (e.g., example) and a top-level domain (e.g., com). In our example URL

 Path: specifies the specific location of the resource within the server's file structure. It can include directories and
subdirectories.

 Query Parameters (Optional): provide additional information to the server about the request. They are appended to
the URL after a question mark (?) and separated by ampersands (&). Each query parameter consists of a key-value pair.

 Example URL: http://www.example.com/index.html?param1=value1


+ 14

URI, URL, URN

 A URN (Uniform Resource Name) is a persistent identifier for a resource, designed to remain
globally unique even if the resource's location changes.

 URNs are designed to remain globally unique and can be used to identify various types of
resources, including documents, books, images, and more.
 Example
+ 15

HTTP Request-Response Model:

 HTTP operates on a client-server model, where


the client (usually a web browser) sends
requests to the server, and the server responds
with the requested data.

 It follows a stateless nature, meaning each


request is independent and does not retain
information from previous requests..
+ 16

HTTP Request-Response Model:

HTTP Request: A client initiates an HTTP request to a server to retrieve a specific resource. The
request consists of several components:
 Request Line: Specifies the HTTP method (e.g., GET, POST, PUT, DELETE), the target resource's path,
and the HTTP version.

 Headers: Provide additional information about the request, such as the user agent, content type, and
cookies.

 Body (optional): Contains additional data sent along with the request, typically used in POST or PUT
requests.
+ 17

HTTP Request-Response Model:

HTTP Response: Once the server receives an HTTP request, it processes the request and sends
back an HTTP response.

The response consists of:

 Status Line: Indicates the HTTP version, a status code (e.g., 200 OK, 404 Not Found), and a brief status
message.

 Headers: Provide information about the response, such as content type, caching directives, and
server information.

 Body: Contains the requested resource, such as HTML content, images, or any other data.
+ 18

Web Browsers

 Web browsers are software applications that


allow users to access and view content on the
World Wide Web. They serve as a gateway
between users and the vast array of resources
available online.

 Browsers interpret HTML, CSS, and JavaScript to


render web content and provide a user-friendly
interface for navigating the web.

 Popular web browsers include Google Chrome,


Mozilla Firefox, Microsoft Edge, and Safari.
+ 19

Web Browsers

 Here are some key aspects to understand about web browsers:

1. Rendering Web Content: Web browsers interpret the code of web pages to render them visually. The
primary languages used to create web pages are HTML, CSS, and JavaScript.
 HTML: HTML provides the structure and content of a web page Browsers parse HTML to
understand and display the content correctly.
 CSS: CSS defines the presentation and styling of web pages. It specifies properties like colors, fonts,
layout, and positioning. Browsers apply CSS rules to render the content with the desired visual
appearance.
 JavaScript: JavaScript is a programming language that adds interactivity and dynamic functionality
to web pages. Browsers execute JavaScript code to handle user interactions, manipulate the page's
elements, and fetch data from servers.
+ 20

Web Browsers

2. User Interface: Web browsers provide a user-friendly interface for navigating the web.
 The interface typically consists of: Address Bar, Navigation Buttons, Bookmarking, Tabs, History

3. Extensions and Add-ons: Web browsers often support extensions or add-ons, which are
additional software components that enhance functionality.
 These can include ad blockers, password managers, developer tools, language translators, and
more.

4. Security and Privacy: Web browsers play a crucial role in ensuring a secure and private
browsing experience. They implement measures like:
 Secure Socket Layer (SSL), Cookie Management, Privacy Settings, Phishing and Malware
Protection
+ 21

HTTP Authentications

 HTTP Authentication It is a security mechanism for verifying a user's identity before granting
them access to protected resources on a web server.

 It involves a challenge-response process where the server prompts the user for credentials,
typically a username and password, and then validates those credentials against a stored
database or authentication server.

 In general, HTTP authentication is used to protect sensitive or private information on a web


server, such as user accounts, financial data, or administrative tools. It ensures that only
authorized users can access these resources.

 The most common HTTP authentication schemes are:


 Basic Authentication, Digest Authentication
+ 22

HTTP Authentications

Basic Authentication:
 This is the simplest form of HTTP authentication.

 When a user tries to access a protected


resource, the server prompts them to enter a
username and password.

 However, Basic Authentication is not considered


secure on its own because the credentials are
transmitted in plain text and can be easily
intercepted.
 HTTPS should be used.
+ 23

HTTP Authentications

Digest Authentication:
 Instead of sending the user's password in plain
text, Digest Authentication uses a cryptographic
hash function to protect the password.

 The server sends a unique challenge, and the


client hashes the challenge with the password
and sends it back.

 It is more secure than Basic Authentication but


still has vulnerabilities.
+ 24

HTTP Authentications

OAuth (Open Authorization)


 OAuth is a protocol for token-based authentication and authorization. It allows a user to
grant a third-party application limited access to their resources without sharing their
credentials.

 OAuth is commonly used for authentication with services like social media platforms.
+ 25

The End

THANK YOU COMMENTS QUESTIONS

You might also like