2-Protocols and Standards
2-Protocols and Standards
interoperability, security, and efficient communication between web browsers and web
servers. Here are some of the most important protocols and standards used in the WWW:
1. HTTP (Hypertext Transfer Protocol):
• HTTP is the foundation of the WWW and is used for transferring data between
a client (usually a web browser) and a server. It defines the rules for how
requests and responses should be formatted and exchanged.
2. HTTPS (HTTP Secure):
• HTTPS is an extension of HTTP that adds a layer of security by encrypting data
exchanged between the client and server. It uses SSL/TLS (Secure Sockets
Layer/Transport Layer Security) for encryption.
3. HTML (Hypertext Markup Language):
• HTML is the markup language used to structure and present content on the
web. It defines the structure of web pages by using tags and attributes.
4. XML (Extensible Markup Language):
• XML is a markup language used for structuring data. It's often used for data
interchange between web services and for configuration files.
5. CSS (Cascading Style Sheets):
• CSS is used for styling web pages. It separates the presentation (styling) of a
webpage from its structure (HTML).
6. JavaScript:
• JavaScript is a scripting language that adds interactivity and dynamic behavior
to web pages. It's executed on the client-side (in the browser).
7. JSON (JavaScript Object Notation):
• JSON is a lightweight data interchange format. It's often used for API responses
and data transmission between the client and server.
8. REST (Representational State Transfer):
• REST is an architectural style for designing networked applications. It uses
HTTP methods (GET, POST, PUT, DELETE) to interact with resources, making it a
popular choice for web services.
9. SOAP (Simple Object Access Protocol):
• SOAP is a protocol for exchanging structured information in the
implementation of web services. It uses XML for message formatting and can
work over various transport protocols.
10. WebSockets:
• WebSockets provide full-duplex communication channels over a single TCP
connection. They allow for real-time, bidirectional communication between
the client and server.
11. WebRTC (Web Real-Time Communication):
• WebRTC is a protocol and API for enabling real-time communication, such as
video and audio chat, directly in web browsers.
12. DNS (Domain Name System):
• DNS translates human-readable domain names (e.g., www.example.com) into
IP addresses (e.g., 192.168.1.1) that computers use to locate each other on
the Internet.
13. URI (Uniform Resource Identifier):
• URIs are used to identify and locate resources on the web. URLs (Uniform
Resource Locators) are a common type of URI that specifies the address of a
resource.
14. Cookies and Sessions:
• Cookies and session management are used to maintain state and user data
across multiple requests. They are often used for user authentication and
personalization.
15. Web Standards (W3C):
• The World Wide Web Consortium (W3C) is responsible for developing and
maintaining web standards, including HTML, CSS, and various XML-based
standards. Adhering to these standards ensures cross-browser compatibility.
16. Web Accessibility (WCAG):
• The Web Content Accessibility Guidelines (WCAG) are a set of guidelines for
making web content accessible to people with disabilities. These guidelines are
essential for inclusive web design.
17. Web Security Standards (OWASP):
• The Open Web Application Security Project (OWASP) provides a list of security
best practices and vulnerabilities to help developers secure their web
applications.
HTTPS
HTTP, or Hypertext Transfer Protocol, is the foundation of the World Wide Web (WWW). It is
used to transfer resources, such as HTML documents, images, videos, and scripts, between
web servers and web browsers. HTTP is a stateless protocol, which means that each request is
independent of any previous requests. This makes it very efficient and scalable.
HTTP is a client-server protocol, which means that the client (usually a web browser) sends a
request to the server, and the server then sends a response back to the client. The request
and response messages are both in plain text, and they are structured using the following
format:
Request:
<method> <request-uri> HTTP/<version>
<headers>
Response:
HTTP/<version> <status-code> <reason-phrase>
<headers>
<body>
The most common HTTP methods are GET, POST, PUT, and DELETE. GET is used to request a
resource from the server. POST is used to create or update a resource on the server. PUT is
used to replace an existing resource on the server. DELETE is used to delete a resource from
the server.
The HTTP status code indicates whether the request was successful or not. The most
common status codes are 200 OK, 404 Not Found, and 500 Internal Server Error.
The HTTP headers are used to provide additional information about the request and
response. For example, the request headers can specify the type of resource being requested,
and the response headers can specify the type of resource being returned.
The HTTP body is the body of the request or response. It contains the actual data being
transferred.
HTTP is a very powerful and versatile protocol, and it is used by a wide variety of web
applications, including web browsers, web servers, and web APIs.
Here are some examples of how HTTP is used in the WWW:
• When you type a web address into your web browser, your browser sends an HTTP
GET request to the web server at that address. The web server then sends back an
HTTP response with the HTML document for that web page.
• When you click on a link on a web page, your browser sends an HTTP GET request to
the web server at the address of that link. The web server then sends back an HTTP
response with the HTML document for the linked web page.
• When you submit a form on a web page, your browser sends an HTTP POST request to
the web server with the data from the form. The web server then processes the data
and sends back an HTTP response with the results.
HTTP is an essential part of the WWW, and it is used to power all of the web applications that
we rely on every day.
xHTML
XHTML stands for eXtensible HyperText Markup Language. It is a markup language that is
based on XML and is used to create web pages. XHTML is similar to HTML, but it is more strict
and follows the XML syntax. This makes XHTML easier to validate and process, and it also
makes it possible to extend XHTML with new features.
XHTML, or Extensible Hypertext Markup Language, is a markup language that represents a
stricter and more structured version of HTML. It was designed to bridge the gap between the
flexibility of HTML and the strictness of XML (Extensible Markup Language). XHTML adheres
to XML rules and syntax, making it a more robust and well-formed language compared to
traditional HTML.
One of the main benefits of using XHTML is that it is easier to validate than HTML. XHTML
documents must be well-formed XML documents, which means that they must follow a strict
set of rules. This can help to prevent errors in web pages and can make them more reliable.
Another benefit of using XHTML is that it is more extensible than HTML. This means that new
features can be added to XHTML without breaking existing web pages. This is because XHTML
is based on XML, which is a very flexible markup language.
XHTML is supported by all major web browsers, so web pages created in XHTML will be
displayed correctly in all browsers. However, it is important to note that XHTML is not as
widely used as HTML. This is because HTML is more forgiving of errors and is easier to learn.
Here is an example of an XHTML document:
HTML, XML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>My XHTML Page</title>
</head>
<body>
<h1>This is my XHTML page.</h1>
</body>
</html>
As you can see, XHTML documents are similar to HTML documents, but they use the XML
syntax. For example, XHTML elements must be closed with an end tag, and all attributes must
be quoted.
Here are some key characteristics and features of XHTML:
1. XML Compliance: XHTML is based on XML, which means it follows XML's strict syntax
rules. All elements must be properly nested, closed, and in lowercase. Attribute values
must be enclosed in double quotes, and all tags must be closed, even self-closing ones
like <img> and <br>.
2. Document Structure: Like HTML, XHTML documents consist of elements enclosed in
angle brackets. The document structure typically includes an opening <html> tag,
<head> and <body> sections, and well-organized content.
3. Strictness: XHTML enforces stricter rules regarding element nesting, attribute naming,
and syntax. This makes it easier for developers to write clean and error-free code.
4. Compatibility: While XHTML is stricter than HTML, it was designed to be backward
compatible with HTML. This means that existing HTML documents can often be
converted to XHTML by making specific adjustments to adhere to XML syntax.
5. Character Encoding: XHTML recommends the use of UTF-8 or other character
encodings for better internationalization and compatibility with various languages and
scripts.
6. Self-Closing Tags: XHTML encourages the use of self-closing tags for elements that
don't have content, such as <img> and <br>, making the markup more consistent.
7. Strict Separation of Structure and Presentation: Like HTML, XHTML encourages the
separation of content structure (defined in the markup) from presentation (defined in
CSS). This separation makes it easier to style and maintain web documents.
8. Accessibility: XHTML emphasizes web accessibility by encouraging the use of semantic
elements and proper labeling of form elements, which helps improve the user
experience for people with disabilities.
9. Compatibility with XML Tools: Because XHTML is based on XML, it can be parsed and
processed using XML tools and libraries, which can be advantageous for certain
applications.
10. Future-Proofing: XHTML was seen as a step toward future web standards, and it was
designed to provide a stable and extensible foundation for web development.
XHTML is a good choice for web developers who want to create web pages that are well-
formed, extensible, and easy to validate. However, it is important to note that XHTML is not as
widely used as HTML, so it is important to consider your audience before choosing whether
to use XHTML or HTML.
Common Gateway Interface (CGI)
Common Gateway Interface (CGI) is a protocol that allows web servers to execute external
programs, often written in scripting languages like Perl, Python, or shell scripts, in response to
client requests. CGI enables dynamic content generation on web servers, making it possible to
create interactive and data-driven web applications.
Here are key aspects of CGI:
1. Request Handling: When a client (usually a web browser) sends a request to a web
server for a CGI script, the server invokes the script, passing along information from
the request, such as form data, query parameters, and HTTP headers.
2. Script Execution: The CGI script can be written in various programming languages and
is executed by the web server's CGI handler. The script processes the request,
generates dynamic content, and often produces an HTML response.
3. Response Generation: The CGI script typically generates HTML, but it can also produce
other content types like JSON or XML. The generated content is sent back to the client
as an HTTP response.
4. Dynamic Web Applications: CGI paved the way for creating dynamic web applications
by allowing for database interactions, user authentication, and personalized content
based on user input.
5. Environment Variables: CGI scripts have access to environment variables containing
information about the request, such as the client's IP address, the HTTP user agent,
and query parameters.
6. Security Considerations: Security is a crucial concern when using CGI. Poorly written
CGI scripts can be vulnerable to security threats, such as code injection and
unauthorized access. Proper input validation and security measures are essential.
7. Performance: Traditional CGI can be less performant than other server-side
technologies like FastCGI or server modules because it involves launching a new
process for each request. This overhead can be mitigated by using alternative
approaches like FastCGI or application server frameworks.
8. Configuration: Web servers need to be configured to handle CGI scripts. This typically
involves specifying which directories or file extensions should be treated as CGI scripts
and defining the interpreter for each script type.
9. Legacy Technology: While CGI played a significant role in the early development of
dynamic web applications, it is considered somewhat outdated in modern web
development. More efficient and scalable technologies, like server-side scripting
languages (e.g., PHP, Python with frameworks like Django or Flask, Ruby on Rails) or
application servers (e.g., Node.js, Java Servlets), are commonly used today.
10. Alternatives to CGI: As mentioned, alternatives to traditional CGI, such as FastCGI and
application server frameworks, provide better performance and scalability by
maintaining a pool of persistent processes that handle multiple requests, reducing the
overhead of process creation.
XML, or Extensible Markup Language, is a widely used markup language for encoding
structured data in a human-readable and machine-readable format. It provides a flexible way
to represent information in a structured manner, making it suitable for various applications,
including data interchange, configuration files, and document markup. Here are the key
features and concepts related to XML:
Markup Language: XML is a markup language, which means it uses tags to define elements
and their relationships within a document. Tags are enclosed in angle brackets, such as
<element>.
Hierarchical Structure: XML documents are organized hierarchically, with a root element
containing nested elements. This hierarchical structure allows for the representation of
complex data relationships.
Elements and Attributes: Elements are the fundamental building blocks of XML documents.
They consist of a start tag, content, and an end tag (e.g., <book>Content</book>). Elements
can also have attributes (e.g., <book title="Sample Title">Content</book>), which provide
additional information about the element.
Validation: XML can be used with Document Type Definitions (DTDs) or XML Schemas to
define the structure and data types allowed in a document. This allows for validation to
ensure documents conform to a specific structure.
Data Interchange: XML is commonly used for data interchange between different systems and
platforms. It provides a standardized way to represent structured data, making it easy to share
information between applications.
Extensibility: The "E" in XML stands for "extensible." Users can define their own custom tags
and document structures, making XML adaptable to various data formats and use cases.
Namespaces: XML allows for the use of namespaces to avoid naming conflicts when different
XML vocabularies are combined in a single document or used across multiple documents.
Transformation: XML documents can be transformed into other formats using technologies
like XSLT (Extensible Stylesheet Language Transformations), allowing for the creation of
different views or representations of the same data.
Parsing: XML documents are typically parsed using software libraries or parsers that convert
the structured data into a format that can be manipulated by programming languages.
Applications: XML is used in a wide range of applications, including web services (SOAP and
REST), configuration files (e.g., in software applications), data storage (e.g., in databases), and
document markup (e.g., XHTML for web content).
JSON Comparison: XML is often compared to JSON (JavaScript Object Notation) as another
data interchange format. JSON is more compact and is frequently used for web APIs and data
transmission in JavaScript applications, while XML offers more flexibility in document
structure.
XPath and XQuery: XPath and XQuery are query languages for selecting and manipulating XML
data. They are used to extract specific data from XML documents.
XML's versatility and readability make it a valuable choice for representing structured data,
particularly when human readability and data interchange between different systems are
essential. However, in some contexts where efficiency and simplicity are paramount,
alternative formats like JSON may be preferred.
WML (Wireless Markup Language)
Wireless Markup Language (WML) is a markup language used for designing content and user
interfaces for mobile devices, particularly early-generation mobile phones and other wireless
devices. WML was developed as part of the WAP (Wireless Application Protocol) stack and
was a key technology for delivering web content to mobile devices in the early days of mobile
internet. Here are some key aspects of WML:
1. Purpose: WML was created to enable the display of web content on mobile devices
with limited processing power, small screens, and limited bandwidth. It was part of
the WAP ecosystem, which aimed to provide access to web-based services on mobile
devices.
2. Markup Language: Like HTML, WML is a markup language that uses tags to define the
structure and presentation of content. However, WML was designed specifically for
mobile devices and has its own set of tags.
3. Deck-Based Structure: WML content is organized into "decks," each of which
represents a screen or page of content. Decks can contain cards, which are individual
content units.
4. Cards: Cards in WML represent individual screens or pages of content. They can
contain text, links, images, and input fields. Users navigate through cards to access
different parts of a mobile application.
5. Lightweight: WML was intentionally designed to be lightweight and efficient, as
mobile devices of the time had limited resources. It uses a compact binary format for
transmission to conserve bandwidth.
6. Limited Multimedia Support: WML primarily supports text-based content with limited
multimedia capabilities. While it can display images, it may not support advanced
multimedia content like video or complex interactive features.
7. Navigation: WML provides navigation elements that allow users to move between
cards and interact with content. This includes softkeys on mobile devices for actions
like "Next" or "Back."
8. WAP Gateway: To access WML content, mobile devices often had to connect to a WAP
gateway, which would convert standard web content (HTML) into WML format for
mobile consumption.
9. Obsolescence: WML and the WAP stack have become largely obsolete as modern
smartphones and mobile devices have advanced in terms of processing power, screen
size, and web capabilities. Modern mobile browsers support HTML5 and CSS3, making
it possible to deliver full web experiences to mobile users.
10. Legacy Systems: Despite its obsolescence, WML may still be encountered in legacy
systems or older mobile devices. However, it is no longer a recommended technology
for mobile web development.
In summary, Wireless Markup Language (WML) was a markup language designed for
delivering web content to early mobile devices as part of the WAP ecosystem. It was essential
during a period when mobile devices had limited capabilities, but it has since been largely
replaced by modern web technologies and standards due to the advancements in mobile
hardware and the capabilities of mobile web browsers.
cHTML (Compact HTML)
cHTML, or Compact HTML, is a markup language designed for use in small-screen devices
with limited processing power and memory, such as mobile phones, PDAs (Personal Digital
Assistants), and other handheld devices. cHTML is often associated with the i-mode service,
which was popular in Japan in the early days of mobile internet. Here are key aspects of
cHTML:
1. Purpose: cHTML was created to enable web content to be displayed on devices with
small screens and limited resources. It was developed by NTT DoCoMo for their i-
mode service, which provided mobile internet access in Japan.
2. Simplified Markup: cHTML is a simplified version of HTML, designed to be more
lightweight and easy to render on small-screen devices. It uses a reduced set of HTML
tags and attributes compared to standard HTML.
3. Limited Multimedia Support: cHTML has limited support for multimedia elements. It
can display images but may not support advanced multimedia features like video or
complex animations.
4. Basic Interaction: cHTML supports basic interactivity through hyperlinks and form
elements. Users can navigate through links and submit forms, but the interaction
capabilities are minimal compared to modern web technologies.
5. Character Encoding: cHTML often uses a specific character encoding tailored for
Japanese text, known as Shift JIS. This encoding is optimized for the Japanese
language.
6. WAP and i-mode: cHTML was used in conjunction with the WAP (Wireless Application
Protocol) stack for mobile internet access. In Japan, it was particularly associated with
the i-mode service, which provided email, web browsing, and other mobile services.
7. Customized Markup: While cHTML shares some similarities with HTML, it includes
certain proprietary tags and attributes specific to i-mode and NTT DoCoMo's mobile
platform. These customizations were aimed at optimizing the mobile browsing
experience for i-mode users.
8. Obsolescence: Like WML (Wireless Markup Language), cHTML has become largely
obsolete as modern smartphones and mobile devices have gained significant
processing power and capabilities. Today, mobile browsers on modern smartphones
typically support standard HTML5 and CSS3, providing a full web experience.
9. Legacy Systems: While cHTML is no longer a recommended technology for mobile
web development, it may still be encountered in legacy systems or older devices,
especially in Japan and other regions where i-mode was popular.
In summary, cHTML, or Compact HTML, was a markup language developed for small-screen
devices with limited resources, particularly for the i-mode mobile internet service in Japan. It
was designed to provide a simplified and lightweight web browsing experience on early
mobile devices. However, as mobile technology has evolved, cHTML has largely been replaced
by standard HTML and modern web technologies for mobile web development.