Lesson 1 Intro To Web Programming
Lesson 1 Intro To Web Programming
Web
Programming
and Applications
06/16/24 1
Introduction to Web
06/16/24 2
History of WWW
06/16/24 3
History of WWW(cont.)
06/16/24 4
HTTP Protocol
06/16/24 5
HTTP Protocol(cont.)
06/16/24 6
HTTP Request /
Response
06/16/24 7
The HTTP Request Circle
06/16/24 8
XHR - XML Http Request
• Despite the XML and Http in the name, XHR is used with
other protocols than HTTP, and the data can be of many
different types like HTML, CSS, XML, JSON, and plain text.
06/16/24 9
XHR - XML Http
Request(cont.)
• The XHR Object is a Web Developers Dream, because you
can:
06/16/24 10
XHR - XML Http
Request(cont.)
• The XHR Object is the underlying concept of AJAX and
JSON:
06/16/24 11
HTTP Request Examples
06/16/24 12
HTTP POST Request Examples
• An HTTP POST request has a similar header to the HTTP GET Request,
specifying the method POST.
• In this example, the values to be handled by the target server are
specified in the message body:
• {
• [Json-formatted data pairs]
• }
Here, the file /home/user/datafile is shown using the HTTP/1.1
protocol from user@linode33 using version 0.8.0 of a program
called MyTools. This application sends json formatted data with a
content length of 32 characters.
06/16/24 13
HTTP Methods
HTTP methods Description
The GET method requests a representation of the specified resource. Requests
GET
using GET should only retrieve data.
The POST method is used to submit an entity to the specified resource, often
POST
causing a change in state or side effects on the server.
The HEAD method asks for a response identical to that of a GET request, but
HEAD
without the response body.
The OPTIONS method is used to describe the communication options for the target
OPTIONS
resource.
The PUT method replaces all current representations of the target resource with
PUT
the request payload.
DELETE The DELETE method deletes the specified resource.
The TRACE method performs a message loop-back test along the path to the target
TRACE
resource.
The CONNECT method establishes a tunnel to the server identified by the target
CONNECT
resource.
PATCH The PATCH method is used to apply partial modifications to a resource.
06/16/24 14
Uniform Resource Identifier(URI)
• The web address denotes the URL and the specific name of the place
or a person or item denotes URN.
• Identifies a resource by name. It always starts with the prefix urn: For
example,
06/16/24 15
URI(cont.)
• The URIs are case insensitive and generally written in lower
case.
• If the URI is written in the form of http: then it is both an URI
and URL but there are some other URI which can also be
used as URL. For example,
Intended Server
URI
ftp://ftp.example.com/index.html file can be located on FTP server
telnet://example.com Telnet server
mailto:admin@codesnail.com Mailbox
https://www.codesnail.com Web Server
06/16/24 16
Status Codes
Status code Reason phrase Description
200 OK The request has succeeded.
The request has succeeded and a new resource has been created as a result.
201 Created
This is typically the response sent after POST requests or some PUT requests.
The request has been received but not yet acted upon. It is noncommittal
since there is no way in HTTP to later send an asynchronous response
202 Accepted
indicating the outcome of the request. It is intended for cases where another
process or server handles the request, or for batch processing.
Moved The URL of the requested resource has been changed permanently. The new
301
permanetaly URL is given in the response.
Although the HTTP standard specifies “unauthorized”, semantically this
401 Unauthorized response means “unauthenticated”. That is, the client must authenticate
itself to get the requested response.
The client does not have access rights to the content; that is, it is
403 Forbidden unauthorized, so the server is refusing to give the requested resource. Unlike
401, the client’s identity is known to the server.
The server can not find the requested resource. In the browser, this means
the URL is not recognized. In an API, this can also mean that the endpoint is
valid but the resource itself does not exist. Servers may also send this
404 Not Found
response instead of 403 to hide the existence of a resource from an
unauthorized client. This response code is probably the most famous one
due to its frequent occurrence on the web.
Internal server
500 The server has encountered a situation it doesn’t know how to handle.
06/16/24
error 17
Client Server Architecture
06/16/24 18
One-tier Architecture:
06/16/24 19
Two-tier Architecture:
06/16/24 21
N-tier Architecture
• N-tier architecture is
also called Distributed
Architecture or Multi-tier
Architecture.
• It is similar to three-tier
architecture but the
number of the
application server is
increased and
represented in individual
tiers in order to
distribute the business
logic so that the logic
can be distributed.
06/16/24 22
Web Browser
06/16/24 23
Web Browser(cont.)
• The web server sends the data back to the browser that
displays the results on internet supported devices.
• On behalf of the users, the browser sends requests to web
servers all over the internet by using HTTP (Hypertext
Transfer Protocol).
• A browser requires a smartphone, computer, or tablet and
internet to work.
06/16/24 24
Browser Functions
• The many functions of web browsers are-
i. Reformat the URL and send the valid HTTP request on
Internet.
ii. When user gives the URL address of particular domain then
web browsers helps converts the DNS to corresponding IP
address.
iv. The web browsers send the HTTP request to the server.
06/16/24 25
Web Browser Architecture
06/16/24 26
Browser Components
• User Interface: The User Interface subsystem is the layer
between the user and the Browser Engine. It provides features
such as toolbars, visual page-load progress, smart download
handling, preferences, and printing.
06/16/24 27
Browser Components(cont.)
06/16/24 28
Web Server
• A Web server is a computer where the web content is
stored.
• Basically web server is used to host the web sites but
there exists other servers also such as gaming, storage,
FTP, email etc.
• Web Server Operations
• Web server software is accessed through the domain
names of websites and ensures the delivery of the site’s
content to the requesting user.
06/16/24 30
Web Development
06/16/24 31
Front End Web Development
06/16/24 32
Front-End Design Roadmap
06/16/24 33
What About Back-End?
• Front-end development refers to the client-side (how a
web page looks).
• Back-end development refers to the server-side (how a
web page works).
• Front-end code is used to create static websites, where
the purpose is to display the web page.
• However, if you want to make your website dynamic
(manage files and databases, add contact forms, control
user-access, etc.), you need to learn a back-end
programming language, like PHP or Python, and use SQL
to communicate with databases.
06/16/24 34
THE END
Thank you!
06/16/24 35