This document defines basic terms related to web applications and HTTP protocols. It explains that a web application is delivered over the internet via a browser and HTML, dynamic pages can display different content than static pages. It also defines that HTTP is the set of rules for file transfers on the web and uses the TCP/IP protocol. The document discusses GET and POST methods for form data submission and that GET appends data to the URL while POST appends to the HTTP request body. It defines CGI as a standard for server-program interaction where requested files are executed as programs.
Overview of HTTP, HTML, WWW and web technologies.
The combo HTTP and HTML is the foundation of the World Wide Web (WWW).
HTML (HyperText Markup Language) defines a text-based format for describing the contents of a web page. HTML is based on tags similar to XML (eXtensible Markup Language), but its definition is less strict.
HTML pages are transported with the HTTP protocol (HyperText Transmission Protocol) over TCP/IP based networks.
The power of the WWW comes with the links based on URLs (Uniform Resource Locators) that connect pages to form a web of content.
Browsers display links as clickable items that, when clicked, trigger the browser to load the web page pointed to by the link.
This statelessness contributed a lot to the stability and scalability of the world wide web where web servers are only tasked with the delivery of web pages while the browser is responsible for the rendering of web pages.
The static nature of the early World Wide Web was soon augmented with the dynamic creation of web pages by web servers or by enriching static web pages with dynamic content.
Technologies like CGI (Common Gateway Interface), JSP (Java Server Pages) or ASP (Active Server Pages) were developed to provide the infrastructure to build dynamic web applications.
These server-side technologies were complemented with client-side technologies like Javascript and AJAX (Asynchronous Javascript And XML).
Web page caching is an important mechanism to reduce latency in loading web pages and reducing network traffic.
HTTP defines different caching control mechanisms. Simpler caching methods are based on web page expiry dates while more complex mechanisms use web page validation.
Overview of HTTP, HTML, WWW and web technologies.
The combo HTTP and HTML is the foundation of the World Wide Web (WWW).
HTML (HyperText Markup Language) defines a text-based format for describing the contents of a web page. HTML is based on tags similar to XML (eXtensible Markup Language), but its definition is less strict.
HTML pages are transported with the HTTP protocol (HyperText Transmission Protocol) over TCP/IP based networks.
The power of the WWW comes with the links based on URLs (Uniform Resource Locators) that connect pages to form a web of content.
Browsers display links as clickable items that, when clicked, trigger the browser to load the web page pointed to by the link.
This statelessness contributed a lot to the stability and scalability of the world wide web where web servers are only tasked with the delivery of web pages while the browser is responsible for the rendering of web pages.
The static nature of the early World Wide Web was soon augmented with the dynamic creation of web pages by web servers or by enriching static web pages with dynamic content.
Technologies like CGI (Common Gateway Interface), JSP (Java Server Pages) or ASP (Active Server Pages) were developed to provide the infrastructure to build dynamic web applications.
These server-side technologies were complemented with client-side technologies like Javascript and AJAX (Asynchronous Javascript And XML).
Web page caching is an important mechanism to reduce latency in loading web pages and reducing network traffic.
HTTP defines different caching control mechanisms. Simpler caching methods are based on web page expiry dates while more complex mechanisms use web page validation.
ASP.NET Web API is the de facto framework for building HTTP-based services in the .NET ecosystem. With its WCF and MVC lineage, Web API brings to the table better architecture, easier configuration, increased testability, and as always, it's customizable from top to bottom. But to properly use Web API it is not enough to get familiar with its architecture and API, you also need to really understand what HTTP is all about. HTTP is the most common application layer protocol in the world, and yet, not many web developers are familiar with HTTP concepts such as of chunking, caching, and persisted connections. In this full-day tutorial, we will focus on designing and implementing HTTP-based services with ASP.NET Web API, and you will learn how to better use it to implement the features provided by HTTP.
Internet Technology Lectures
HTTP & HTTPS
Lecturer: Saman M. Almufti / Kurdistan Region, Nawroz University
facebook: https://www.facebook.com/saman.malmufti
YouTube link: https://youtu.be/I8QOWD_GH5g
Overview of what's going on in the HTTP world. This is the latest version of a talk I've given in the past at Google, Bell Labs and QCon San Francisco.
Introduce the Java Enterprise (J2EE) model
Present the Hypertext Markup Language (HTML) tags
Present the Hypertext Transmission Protocol (HTTP)
Define an HTTP client request, server response, and HTTP request methods
THE FOLLOWING SUN CERTIFIED WEBCOMPONENT DEVELOPER FOR J2EEPLATFORM EXAM OBJECTIVES COVERED IN THIS CHAPTER:
1.1 For each of the HTTP methods,GET,POST, and PUT, identify the corresponding method in the HttpServlet class.
1.2 For each of the HTTP methods,GET ,POST, and HEAD, identify triggers that might cause a browser to use the method, and identify benefits or functionality of the method.
An overview of the HTTP protocol showing the protocol basics such as protocol versions, messages, headers, status codes, connection management, cookies and more.
But it still remains an overview without in-depth information. Also some key aspects are left out (because of limited time) such as authentication, content negotiation, robots, web architecture etc..
ASP.NET Web API is the de facto framework for building HTTP-based services in the .NET ecosystem. With its WCF and MVC lineage, Web API brings to the table better architecture, easier configuration, increased testability, and as always, it's customizable from top to bottom. But to properly use Web API it is not enough to get familiar with its architecture and API, you also need to really understand what HTTP is all about. HTTP is the most common application layer protocol in the world, and yet, not many web developers are familiar with HTTP concepts such as of chunking, caching, and persisted connections. In this full-day tutorial, we will focus on designing and implementing HTTP-based services with ASP.NET Web API, and you will learn how to better use it to implement the features provided by HTTP.
Internet Technology Lectures
HTTP & HTTPS
Lecturer: Saman M. Almufti / Kurdistan Region, Nawroz University
facebook: https://www.facebook.com/saman.malmufti
YouTube link: https://youtu.be/I8QOWD_GH5g
Overview of what's going on in the HTTP world. This is the latest version of a talk I've given in the past at Google, Bell Labs and QCon San Francisco.
Introduce the Java Enterprise (J2EE) model
Present the Hypertext Markup Language (HTML) tags
Present the Hypertext Transmission Protocol (HTTP)
Define an HTTP client request, server response, and HTTP request methods
THE FOLLOWING SUN CERTIFIED WEBCOMPONENT DEVELOPER FOR J2EEPLATFORM EXAM OBJECTIVES COVERED IN THIS CHAPTER:
1.1 For each of the HTTP methods,GET,POST, and PUT, identify the corresponding method in the HttpServlet class.
1.2 For each of the HTTP methods,GET ,POST, and HEAD, identify triggers that might cause a browser to use the method, and identify benefits or functionality of the method.
An overview of the HTTP protocol showing the protocol basics such as protocol versions, messages, headers, status codes, connection management, cookies and more.
But it still remains an overview without in-depth information. Also some key aspects are left out (because of limited time) such as authentication, content negotiation, robots, web architecture etc..
A CGI program is any program designed to accept and return data that conforms to the CGI specification. The program could be written in any programming language, including C, Perl, Java, or Visual Basic.
Synthetic Fiber Construction in lab .pptxPavel ( NSTU)
Synthetic fiber production is a fascinating and complex field that blends chemistry, engineering, and environmental science. By understanding these aspects, students can gain a comprehensive view of synthetic fiber production, its impact on society and the environment, and the potential for future innovations. Synthetic fibers play a crucial role in modern society, impacting various aspects of daily life, industry, and the environment. ynthetic fibers are integral to modern life, offering a range of benefits from cost-effectiveness and versatility to innovative applications and performance characteristics. While they pose environmental challenges, ongoing research and development aim to create more sustainable and eco-friendly alternatives. Understanding the importance of synthetic fibers helps in appreciating their role in the economy, industry, and daily life, while also emphasizing the need for sustainable practices and innovation.
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdfTechSoup
In this webinar you will learn how your organization can access TechSoup's wide variety of product discount and donation programs. From hardware to software, we'll give you a tour of the tools available to help your nonprofit with productivity, collaboration, financial management, donor tracking, security, and more.
Read| The latest issue of The Challenger is here! We are thrilled to announce that our school paper has qualified for the NATIONAL SCHOOLS PRESS CONFERENCE (NSPC) 2024. Thank you for your unwavering support and trust. Dive into the stories that made us stand out!
The Roman Empire A Historical Colossus.pdfkaushalkr1407
The Roman Empire, a vast and enduring power, stands as one of history's most remarkable civilizations, leaving an indelible imprint on the world. It emerged from the Roman Republic, transitioning into an imperial powerhouse under the leadership of Augustus Caesar in 27 BCE. This transformation marked the beginning of an era defined by unprecedented territorial expansion, architectural marvels, and profound cultural influence.
The empire's roots lie in the city of Rome, founded, according to legend, by Romulus in 753 BCE. Over centuries, Rome evolved from a small settlement to a formidable republic, characterized by a complex political system with elected officials and checks on power. However, internal strife, class conflicts, and military ambitions paved the way for the end of the Republic. Julius Caesar’s dictatorship and subsequent assassination in 44 BCE created a power vacuum, leading to a civil war. Octavian, later Augustus, emerged victorious, heralding the Roman Empire’s birth.
Under Augustus, the empire experienced the Pax Romana, a 200-year period of relative peace and stability. Augustus reformed the military, established efficient administrative systems, and initiated grand construction projects. The empire's borders expanded, encompassing territories from Britain to Egypt and from Spain to the Euphrates. Roman legions, renowned for their discipline and engineering prowess, secured and maintained these vast territories, building roads, fortifications, and cities that facilitated control and integration.
The Roman Empire’s society was hierarchical, with a rigid class system. At the top were the patricians, wealthy elites who held significant political power. Below them were the plebeians, free citizens with limited political influence, and the vast numbers of slaves who formed the backbone of the economy. The family unit was central, governed by the paterfamilias, the male head who held absolute authority.
Culturally, the Romans were eclectic, absorbing and adapting elements from the civilizations they encountered, particularly the Greeks. Roman art, literature, and philosophy reflected this synthesis, creating a rich cultural tapestry. Latin, the Roman language, became the lingua franca of the Western world, influencing numerous modern languages.
Roman architecture and engineering achievements were monumental. They perfected the arch, vault, and dome, constructing enduring structures like the Colosseum, Pantheon, and aqueducts. These engineering marvels not only showcased Roman ingenuity but also served practical purposes, from public entertainment to water supply.
Ethnobotany and Ethnopharmacology:
Ethnobotany in herbal drug evaluation,
Impact of Ethnobotany in traditional medicine,
New development in herbals,
Bio-prospecting tools for drug discovery,
Role of Ethnopharmacology in drug evaluation,
Reverse Pharmacology.
Palestine last event orientationfvgnh .pptxRaedMohamed3
An EFL lesson about the current events in Palestine. It is intended to be for intermediate students who wish to increase their listening skills through a short lesson in power point.
Operation “Blue Star” is the only event in the history of Independent India where the state went into war with its own people. Even after about 40 years it is not clear if it was culmination of states anger over people of the region, a political game of power or start of dictatorial chapter in the democratic setup.
The people of Punjab felt alienated from main stream due to denial of their just demands during a long democratic struggle since independence. As it happen all over the word, it led to militant struggle with great loss of lives of military, police and civilian personnel. Killing of Indira Gandhi and massacre of innocent Sikhs in Delhi and other India cities was also associated with this movement.
Instructions for Submissions thorugh G- Classroom.pptxJheel Barad
This presentation provides a briefing on how to upload submissions and documents in Google Classroom. It was prepared as part of an orientation for new Sainik School in-service teacher trainees. As a training officer, my goal is to ensure that you are comfortable and proficient with this essential tool for managing assignments and fostering student engagement.
Unit 8 - Information and Communication Technology (Paper I).pdfThiyagu K
This slides describes the basic concepts of ICT, basics of Email, Emerging Technology and Digital Initiatives in Education. This presentations aligns with the UGC Paper I syllabus.
Model Attribute Check Company Auto PropertyCeline George
In Odoo, the multi-company feature allows you to manage multiple companies within a single Odoo database instance. Each company can have its own configurations while still sharing common resources such as products, customers, and suppliers.
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxEduSkills OECD
Andreas Schleicher presents at the OECD webinar ‘Digital devices in schools: detrimental distraction or secret to success?’ on 27 May 2024. The presentation was based on findings from PISA 2022 results and the webinar helped launch the PISA in Focus ‘Managing screen time: How to protect and equip students against distraction’ https://www.oecd-ilibrary.org/education/managing-screen-time_7c225af4-en and the OECD Education Policy Perspective ‘Students, digital devices and success’ can be found here - https://oe.cd/il/5yV
How libraries can support authors with open access requirements for UKRI fund...
CGI by rj
1. Basic terms that we know
Web Application
• A Web application (Web app) is an application
program that is stored on a remote server and
delivered over the Internet through a browser
interface.
Web Server
• A web server is a computer system that processes
requests via HTTP, the basic network protocol
used to distribute information on the World Wide
Web.
2. Web Browser
• A web browser is a software application for
retrieving, presenting and traversing
information resources on the World Wide Web.
HTML
• HyperText Markup Language (HTML) is the
standard markup language for creating web
pages and web applications.
3. Static Pages
• static Web pages are those with content that
cannot change without a developer editing its
source code,
Dynamic Pages
• while dynamic Web pages can display different
content from the same source code.
4. What is HTTP?
HTTP (Hypertext Transfer Protocol) is the set of rules
for transferring files (text, graphic images, sound,
video, and other multimedia files) on the World Wide
Web.
As soon as a Web user opens their Web browser, the user
is indirectly making use of HTTP.
HTTP is an application protocol that runs on top of the
TCP/IP suite of protocols (the foundation protocols for the
Internet).
TCP/IP (Transmission Control Protocol/Internet Protocol) is
the basic communication language or protocol of the
Internet. It can also be used as a communications protocol
in a private network (either an intranet or an extranet).
5.
6. Get & Post Methods
It specifies how to send the form data
to a web server.
The data can be sent as URL
variables, by using the get (default)
method or as HTTP post, by using post
method.
7. Get method
Get sends the data as part of the URL.
Appends form-data into the URL in name/value pairs.
The length of a URL is limited 2048 characters.
Never use GET method if you have password or other sensitive
information to be sent to the server.
Get is better for non secure data. Like query string in Google
(https://www.google.co.in/?
gfe_rd=cr&ei=KJWNWJ_lKKnT8ge0gYjQBw#safe=strict&q=what+i
s+php)
Get can’t be used to send binary data. Ex. Images or word
documents.
<form action=“myform.php” method=“GET”/>
8. Post Method
http post requests supply additional data form the client (browser)
to the server in the message body.
Appends form-data inside the body of the HTTP request (data is not
shown is in URL)
Don’t have any restriction on data size to be sent.
Post can not be bookmarked.
Used to send ASCII as well as binary data. (img, word document)
Is safe because the parameters are not stored in browser history or
in the web server logs.
<from action=“some.php” method=“post”/>
9.
10. What is CGI?
Web Browsing
To understand the concept of CGI, let us see what happens
when we click a hyper link to browse a particular web page
or URL.
Your browser contacts the HTTP web server and
demands for the URL, i.e., filename.
Web Server parses the URL and looks for the filename.
If it finds that file then sends it back to the browser,
otherwise sends an error message indicating that you
requested a wrong file.
Web browser takes response from web server and displays
either the received file or error message.
11. What is CGI?
However, it is possible to set up the HTTP server so that
whenever a file in a certain directory is requested that
file is not sent back;
instead it is executed as a program, and whatever that
program outputs is sent back for your browser to display.
This function is called the Common Gateway Interface or
CGI and the programs are called CGI scripts.
CGI standard defines server-program interaction
• Developed at the National Center for Supercomputing Applications
(NCSA)
CGI was the first way of generating dynamic content.
These CGI programs can be a Python Script, PERL
Script, Shell Script, C or C++ program, etc.
14. How to Run Python on
XAMPP web server
you have installed both xampp and
python on the C Drive:
c:/xampp
c:/python27 or c:/python35
15. Running Python Scripts via
CGI
Modify http.conf
Locate the configuration file http.conf in
c:xamppapacheconfhttpd.conf.
In http.conf look for this line: AddHandler cgi-script
.cgi .pl .asp.
Modify it so it looks like this: AddHandler cgi-script .cgi .pl
.asp .py
You probably won't need to do this, but just to be sure, look
for this line: Options Indexes FollowSymLinks.
Ensure that it looks like this: Options Indexes
FollowSymLinks Includes ExecCGI
Restart Apache
16. At the top of each Python script you create,
set the path to your version of Python.
For instance, ours is in C:Python27 so we
write: #!/Python27/python
Example script, create folder
at C:xampphtdocs and create script file
with .cgi extension containing the following
code within the folder:-
17. Simple CGI Application
#!/Python27/python.exe
print "Content-type:text/htmlrnrn"
print '<html>'
print '<head>'
print '<title>Hello Word - First CGI Program</title>'
print '</head>'
print '<body>'
print '<h2>Hello Word! This is my first CGI
program</h2>'
print '</body>'
print '</html>'
18. How to process html form data
with Python
Create a file named "process_form" with the
code below and save it in a file with .py or
.cgi extension at this location
"C:xampphtdocscgirj" where the html form
file (myForm.html) above is located.
Edit the html form "action" attribute to point to
the (cgi or py) python file above
(process_form.cgi).
19. CGI module
There is one primary class in the cgi module that does all
the work: the FieldStorage class.
This class should be instantiated when a Python CGI script
begins, as it will read in all the pertinent user information
from the Web client (via the Web server).
Once this object has been instantiated, it will consist of a
dictionary-like object that has a set of key-value pairs.
The keys are the names of the form items that were
passed in through the form while the values contain the
corresponding data.
20. These values themselves can be one of three objects.
They can be FieldStorage objects (instances) as well as
instances of a similar class called MiniFieldStorage, which
is used in cases where no file uploads or multiple-part form
data is involved.
MiniFieldStorage instances contain only the key-value pair
of the name and the data. Lastly, they can be a list of such
objects.
This occurs when a form contains more than one input item
with the same field name.
21. Cgitb module
The cgitb module provides a special exception handler for Python
scripts. (Its name is a bit misleading. It was originally designed to display
extensive traceback information in HTML for CGI scripts. It was later
generalized to also display this information in plain text.)
After this module is activated, if an uncaught exception occurs, a
detailed, formatted report will be displayed.
The report includes a traceback showing excerpts of the source code for
each level, as well as the values of the arguments and local variables to
currently running functions, to help you debug the problem.
Optionally, you can save this information to a file instead of sending it to
the browser.
To enable this feature, simply add this to the top of your CGI script:
import cgitb
cgitb.enable()
22. Field storage
To access the data submitted by the form in our script we
will need to make use of the FieldStorage() function
available in the cgi module of Python.
For example, we would assign the data from the form to a
Python variable in the following way:
formData = cgi.FieldStorage()
The variable formData now contains every piece of
data submitted by the form.
23. Other tool that provide Apache web
server on PC are WAMP or AMPPS.
AMPPS is a stack of Apache, MySQL,
MongoDB, PHP, Perl & Python.
24. CGI: Pros and Cons
Pros of CGI:
• Simple; suitable for small once-off tasks
• Supported by all web servers
Cons of CGI:
• Slow; web server forks new process for every
request
• Parameter decoding tedious
26. Cookie
Cookies are basically key-value pairs
that a web server can set for a client's
web browser.
This lets server programs track what
pages a user has visited or what actions
the user has performed. Cookies are
very useful for implementing things like
log-in sessions or shopping carts.
27. Using Cookies in CGI
HTTP protocol is a stateless protocol. For a commercial
website, it is required to maintain session information among
different pages.
For example, one user registration ends after completing
many pages. How to maintain user's session information
across all the web pages?
In many situations, using cookies is the most efficient
method of remembering and tracking preferences,
purchases, commissions, and other information required for
better visitor experience or site statistics.
28. How It Works?
Your server sends some data to the visitor's browser in the
form of a cookie.
The browser may accept the cookie.
If it does, it is stored as a plain text record on the visitor's
hard drive.
Now, when the visitor arrives at another page on your site,
the cookie is available for retrieval. Once retrieved, your
server knows/remembers what was stored.
The HTTP headers are a series of text parameters sparated
by carriage return and line feed characters.
Cookies are set using the Set-Cookie parameter.
29. Cookies are a plain text data record of 5 variable-length fields:
Expires: The date the cookie will expire. If this is blank, the cookie will
expire when the visitor quits the browser.
Domain: The domain name of your site.
Path: The path to the directory or web page that sets the cookie. This
may be blank if you want to retrieve the cookie from any directory or
page.
Secure: If this field contains the word "secure", then the cookie may
only be retrieved with a secure server. If this field is blank, no such
restriction exists.
Name=Value: Cookies are set and retrieved in the form of key and
value pairs.
30. Setting up Cookies
It is very easy to send cookies to browser.
These cookies are sent along with HTTP
Header before to Content-type field.
Assuming you want to set UserID and
Password as cookies.
31. File Upload Example
To upload a file, the HTML form must
have the enctype attribute set to
multipart/form-data.
The input tag with the file type creates a
"Browse" button.