Module 1 - Up
Module 1 - Up
ITC501
Subject Incharge
Priya Chaudhari
Assistant Professor
Module 1: Web programming fundamentals
Working of web browser
HTTP protocol
HTTPS, DNS
TLS
XML introduction
Json introduction
DOM
URL
URI
REST API
Self-learning Topics: : Nginx server 03 CO1
Tim Berners-Lee
Stop Button
Home Button
Tabbed Browsing
Bookmarks
High-level architecture of browser
JavaScript Interpreter
Interprets and executes the JavaScript code embedded in a website.
interpreted results are sent to the rendering engine for display.
If the script is external then first the resource is fetched from the
network
Main components of the browser
UI Backend:
Used for drawing basic widgets like combo boxes and windows.
This backend exposes a generic interface that is not platform specific.
It underneath uses operating system user interface methods.
Data Persistence/Storage:
A persistence layer.
LocalStorage, IndexedDB, WebSQL and FileSystem are supported.
It is a small database created on the local drive of the computer where the
browser is installed.
It manages user data such as cache, cookies, bookmarks and preferences
Working of Web Browser?
3 steps
1) Contact to DNS Server
2) Contact to Server
3) Rendering
Working of Web Browser?
Rendering engine
The networking layer will start sending the contents of the
requested documents to the rendering engine in chunks of 8KBs.
Module 2: Web programming fundamentals
Working of web browser
HTTP protocol
HTTPS, DNS
TLS
XML introduction
Json introduction
DOM
URL
URI
REST API.
Self-learning Topics: : Nginx server 03 CO1
HTTP protocol
Between the client and the server there are numerous entities, collectively
called proxies, which perform different operations and act as gateways
or caches.
Components of HTTP-based systems
Between the client and the server there are numerous entities, collectively
called proxies, which perform different operations and act as gateways
or caches.
Client
Client: the user-agent
The user-agent is any tool that acts on the behalf of the user.
Programs used by engineers and Web developers.
Browser sends an original request to fetch the HTML document.
Additional requests corresponding to execution scripts, layout information
(CSS) to display, and sub-resources contained within the page.
Browser then mixes these resources to present to the user a complete document.
Scripts executed by the browser can fetch more resources in later phases and
the browser updates the Web page accordingly.
A Web page is a hypertext document.
Components of HTTP-based systems
Between the client and the server there are numerous entities, collectively
called proxies, which perform different operations and act as gateways
or caches.
Server
The Web server
Serves the document as requested by the client.
It is not necessarily a single machine, but several server software instances can
be hosted on the same machine.
collection of servers
Components of HTTP-based systems
Between the client and the server there are numerous entities, collectively
called proxies, which perform different operations and act as gateways
or caches.
Proxy Proxy
Proxies
Machines relay the HTTP messages.
Most of these operate at the transport, network or physical levels.
Those operating at the application layers are generally called proxies.
Transparent or non-transparent.
• caching
• filtering
• load balancing
• authentication
• logging
Basic aspects of HTTP
HTTP is simple
HTTP is extensible
HTTP is stateless.
HTTP-connections
HTTP Messages
Request
HTTP Messages
Response
Status Code
HTTP and mixed-content websites can expect more browser warnings and
errors, lower user trust and poorer SEO than if they had enabled HTTPS.
HTTPS
Difference between HTTP and HTTPS.
Why to use HTTPS?
Working of HTTPS
What happens if website doesn’t use HTTPS?
How do I know if a website uses HTTPS?
How do I know if a website uses HTTPS?
An HTTPS URL begins with https:// instead of [Link] Modern web browsers
also indicate that a user is visiting a secure HTTPS website by displaying a
closed padlock symbol to the left of the URL:
How do I enable HTTPS on my website?
Install an SSL/TLS certificate signed by a publicly trusted Certificate
Authority(CA) on your web server.
Knowledgebase - [Link]
Module 2: Web programming fundamentals
Working of web browser
HTTP protocol
HTTPS, DNS
TLS
XML introduction
Json introduction
DOM
URL
URI
REST API.
Self-learning Topics: : Nginx server 03 CO1
DNS- Domain Name System
Domain Name: Address of website.
Directory Service
Text
XML syntax
<?xml version=“1.0”?>
<Contact-info> Markup
<FirstName>Saisha</FirstName>
<LastName>Zindal</LastName>
Text
XML syntax
<?xml version=“1.0”?>
<Contact-info> Markup
<FirstName>Saisha</FirstName>
<LastName>Zindal</LastName>
Text
<phone>1234567891</phone>
XML syntax
<?xml version=“1.0”?>
<Contact-info> Markup
<FirstName>Saisha</FirstName>
<LastName>Zindal</LastName>
Text
<phone>1234567891</phone>
</contact-info>
Syntax Rules
XML Declaration
XML References
• begin with the symbol "&" and end with the symbol ";".
• 2 types:
• Entity References: e.g. &
• Character References : e.g. A
XML Validation
Well formed XML document =>Satisfy all basic syntax conditions.
Rules=>
It must begin with the XML declaration.
It must have one unique root element.
All start tags of XML document must match end tags.
XML tags are case sensitive.
All tags must be closed.
All elements must be properly nested.
All attribute values must be quoted.
XML entities must be used for special characters.
Example
Example
Example
Example
Simple XML Document
Simple XML Document
Simple XML Document
Difference between HTML and XML
HTML Vs XML
Advantages
Light weight: it becomes easier to get and load the requested data
quickly.
}
}
JSON object
Key: Value pair.
Keys=>string, Value=>any type.
Object
{
“employee”:{
“name”: “Sai”,
“Salary”: 56000,
“married”: true
}
}
JSON object
Key: Value pair.
Keys=>string, Value=>any type.
Object
{
“employee”:{
“name”: “Sai”,
“Salary”: 56000,
“married”: true
}
}
Keys
JSON object
Key: Value pair.
Keys=>string, Value=>any type.
Object
{
“employee”:{
Values
“name”: “Sai”,
“Salary”: 56000,
“married”: true
}
}
Keys
Data Structures and Rules
JSON supports the following two data structures
Collection of name/value pairs
Ordered list of values − It includes array, list, vector or sequence etc.
Data types: Number, String, Boolean, Null, object, array.
Syntax Rules:
An object begins with {(left brace) and ends with }(right brace).
Each name is followed by :(colon) and the name/value pairs are separated by
,(comma).
The string value must be enclosed within double quote " ".
The number value will be simply written.
The boolean values will be simple written as true or false.
JSON supports numbers in double precision floating-point format; digit,
fraction and exponent.
Json object with Numbers:
JSON Object {
Json object with strings: “integer”: 34,
“fraction”: .2143,
{
“Exponent”: 6.5678e+0
“name”: “Veena” }
}
Json Nested object example:
Json object with Booleans: {
{
“name”: “Alice”,
“name”: true,
“age”: false “address: {
} “street address”: “MG Road”,
“city”: “Mumbai”
}
}
JSON Object
JSON Array
String array=> ["Ford", "BMW", "Fiat"]
Number array=> [12, 34, 45, 67]
Array of objects:
{
“employees”:[
{“name”: “Ragini”, “id”: 12},
{“name”: “Riya”, “id”: 14},
{“name”: “Sunny”, “id”: 16}
]
}
Difference between XML and JSON
JSON XML
JSON is lightweight thus simple to read XML is less simple than JSON
and write
JSON supports array data structure. XML doesn't support array data structure.
JSON files are more human readable. XML files are less human readable
Provides scalar data types and the ability Does not provide any notion of data types.
to express structured data through arrays One must rely on XML Schema for adding
and objects. type information.
Native object support. Objects have to be expressed by
conventions, often through a mixed use of
attributes and elements
Similarities between JSON and XML
Both are simple and open.
Both supports unicode. So internationalization is supported by
JSON and XML both.
Both represents self describing data. Both are interoperable or
language-independent.
Module 2: Web programming fundamentals
Working of web browser
HTTP protocol
HTTPS, DNS
TLS
XML introduction
Json introduction
DOM
URL, URI
REST API.
Self-learning Topics: : Nginx server 03 CO1
URL- Uniform Resource Locator
Name URN
URI
Location URL
URL, URN, URI
http ://[Link]/[Link]
http ://[Link]/[Link]
http ://[Link]/[Link]
Fragment
Summarize
We use URL, URI and URN to identify resources.
URN can specify address or name or both.
We usually use URL to identify the resources.
URL consists of components such as protocol, domain, port, path,
query string, fragment.
Module 2: Web programming fundamentals
Working of web browser
HTTP protocol
HTTPS, DNS
TLS
XML introduction
Json introduction
DOM
URL, URI
REST API.
Self-learning Topics: : Nginx server 03 CO1
DOM
Let’s understand this using the example of XML.
Tree Structure
<books>
<book>
<author>carson</author>
<price format=“dollar”>31.95</price>
<pubdate>05/01/2021</pubdate>
</book>
<pubinfo>
<publisher>Mspress</publisher>
<state>WA</state>
</pubinfo>
</books>
<script>
const element = [Link]("intro");
</script>
Method
The getElementByTagName()
Method getElementsByTagName();
returns all elements with a specified tag name.
[Link]("tagname");
Advantages
Language and platform dependent
Traversable
Modifiable
Disadvantage
Consumes more memory
Slower operational speed.
Module 2: Web programming fundamentals
Working of web browser
HTTP protocol
HTTPS, DNS
TLS
XML introduction
Json introduction
DOM
URL, URI
REST API.
Self-learning Topics: : Nginx server 03 CO1
Rest API
Representational State Transfer.
It is a software architectural style that defines the constraints to
create web services.
E.g. BookMyShow App
Example- BookMyShow App
HTML
Page Server
Example- BookMyShow App
Rest API
Look into so much of methods.
RestAPI came into picture to avoid the same.
RestAPI create the objects and send request through the object.
Rest API
Rest API
It is an architectural style as well as an approach for
communications that is often used in various web services
development.
Language of internet
Stateless.
Lessers the use of bandwidth.
Features
Simpler than SOAP
Documentation
Error messages
Principles
• Resource-
Based
• Manipulation
of resources
• Self-
Descriptive
messages
• Hypermedia
REST API Methods
HTTP methods=> GET, PUT, POST, DELETE
CRUD Operations – Create, Read, Update and Delete
URI: [Link]
Questions
Explain 3-tier web architecture. 5M
Write a short note on HTTP. 5M
Write a short note on HTTPs. 5M
What are the HTTP methods?? 5M
Short note on HTTP request and response message 5M
Short note on TLS. 5M
Difference between SSL and TLS 5M
Explain XML and JSON with example 5M
What is DOM? Explain different types of DOM. 5M
Differentiate between URL and URI with example. 5M
Explain principles of REST API. 5M
Explain REST API methods in detail. 5M
References
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
c95ad628a509
• [Link]
US/docs/Web/Performance/How_browsers_work
• [Link]
Security-TLS
• [Link]
• [Link]
Thank you!!