600-152 People Data and the Web Forms and CGI CGI. Facilitating interactive web applications



Similar documents
People Data and the Web Forms and CGI. HTML forms. A user interface to CGI applications

How to write a CGI for the Apache Web server in C

at () in C:\wamp\www\icaatom-1.2.0\icaatom \plugins\sfLucenePlugin\lib\vendor\Zend\Search\Lucene\Document.php line

CGI An Example. CGI Model (Pieces)

10. Java Servelet. Introduction

Chapter 27 Hypertext Transfer Protocol

Web Services April 21st, 2009 with Hunter Pitelka

GET /FB/index.html HTTP/1.1 Host: lmi32.cnam.fr

CTIS 256 Web Technologies II. Week # 1 Serkan GENÇ

Outline Definition of Webserver HTTP Static is no fun Software SSL. Webserver. in a nutshell. Sebastian Hollizeck. June, the 4 th 2013

Internet Technologies. World Wide Web (WWW) Proxy Server Network Address Translator (NAT)

1. When will an IP process drop a datagram? 2. When will an IP process fragment a datagram? 3. When will a TCP process drop a segment?

7 Why Use Perl for CGI?

Chapter 8. Forms and Form Processing

Hypertext for Hyper Techs

Web Programming. Robert M. Dondero, Ph.D. Princeton University

HTTP Fingerprinting and Advanced Assessment Techniques

URLs and HTTP. ICW Lecture 10 Tom Chothia

8/9/16. Server-Side Web Programming Intro. The Hamburger Model. To make a Web server based program

Application layer Web 2.0

How to Run an Apache HTTP Server With a Protocol

The Hyper-Text Transfer Protocol (HTTP)

WWW. World Wide Web Aka The Internet. dr. C. P. J. Koymans. Informatics Institute Universiteit van Amsterdam. November 30, 2007

Protocolo HTTP. Web and HTTP. HTTP overview. HTTP overview

INT322. By the end of this week you will: (1)understand the interaction between a browser, web server, web script, interpreter, and database server.

CS615 - Aspects of System Administration

The Application Layer. CS158a Chris Pollett May 9, 2007.

CGI Programming on the World Wide Web

Network Technologies

HTTP Protocol. Bartosz Walter

reference: HTTP: The Definitive Guide by David Gourley and Brian Totty (O Reilly, 2002)

Cyber Security Workshop Ethical Web Hacking

INTRUSION DETECTION AND PREVENTION SYSTEM: CGI ATTACKS. A Thesis. Presented to. The Faculty of the Department of Computer Science

HTTP. Internet Engineering. Fall Bahador Bakhshi CE & IT Department, Amirkabir University of Technology

World Wide Web. Before WWW

Web. Services. Web Technologies. Today. Web. Technologies. Internet WWW. Protocols TCP/IP HTTP. Apache. Next Time. Lecture # Apache.

CONTENT of this CHAPTER

Introduction Les failles les plus courantes Les injections SQL. Failles Web. Maxime Arthaud. net7. Jeudi 03 avril 2014.

Playing with Web Application Firewalls

Internet Technologies Internet Protocols and Services

Anatomy of a Pass-Back-Attack: Intercepting Authentication Credentials Stored in Multifunction Printers

Lecture 2. Internet: who talks with whom?

HTTP Response Splitting

Computer Networks. Lecture 7: Application layer: FTP and HTTP. Marcin Bieńkowski. Institute of Computer Science University of Wrocław

Web applications. Web security: web basics. HTTP requests. URLs. GET request. Myrto Arapinis School of Informatics University of Edinburgh

Research of Web Real-Time Communication Based on Web Socket

HTTP Caching & Cache-Busting for Content Publishers

CS640: Introduction to Computer Networks. Applications FTP: The File Transfer Protocol

Forms, CGI Objectives. HTML forms. Form example. Form example...

The Web: some jargon. User agent for Web is called a browser: Web page: Most Web pages consist of: Server for Web is called Web server:

Security-Assessment.com White Paper Leveraging XSRF with Apache Web Server Compatibility with older browser feature and Java Applet

APACHE WEB SERVER. Andri Mirzal, PhD N

1. The Web: HTTP; file transfer: FTP; remote login: Telnet; Network News: NNTP; SMTP.

By Bardia, Patit, and Rozheh

Security Issues in Web Programming. Robert M. Dondero, Ph.D. Princeton University

Data Communication I

Dynamic Content. Dynamic Web Content: HTML Forms CGI Web Servers and HTTP

Polyglot: Automatic Extraction of Protocol Message Format using Dynamic Binary Analysis

Web Archiving for ediscovery

TCP/IP Networking An Example

Modern Web Development From Angle Brackets to Web Sockets

Implementation of Embedded Web server using TEA algorithm

Fachgebiet Technische Informatik, Joachim Zumbrägel

International Journal of Engineering & Technology IJET-IJENS Vol:14 No:06 44

APACHE HTTP SERVER 2.2.8

Chapter 2: Interactive Web Applications

WHAT IS A WEB SERVER?

Domain Name System (DNS)

COMP 112 Assignment 1: HTTP Servers

What is Distributed Annotation System?

1 Introduction: Network Applications

LabVIEW Internet Toolkit User Guide

Web Browsing Examples. How Web Browsing and HTTP Works

Internet Technologies_1. Doc. Ing. František Huňka, CSc.

Lektion 2: Web als Graph / Web als System

Evolution of the WWW. Communication in the WWW. WWW, HTML, URL and HTTP. HTTP Abstract Message Format. The Client/Server model is used:

ivoyeur: permission to parse

Web Development. Owen Sacco. ICS2205/ICS2230 Web Intelligence

CS 5480/6480: Computer Networks Spring 2012 Homework 1 Solutions Due by 9:00 AM MT on January 31 st 2012

10.1 The Common Gateway Interface

Slides from INF3331 lectures - web programming in Python

CIT 380: Securing Computer Systems

Alteon Browser-Smart Load Balancing

Web Design and Development ACS-1809

Internet Technologies 4-http. F. Ricci 2010/2011

HTTP Authentifizierung


The Web History (I) The Web History (II)

HTTP - METHODS. Same as GET, but transfers the status line and header section only.

No. Time Source Destination Protocol Info HTTP GET /ethereal-labs/http-ethereal-file1.html HTTP/1.

The World-Wide Web Gateway to Hyper-G: Using a Connectionless Protocol to Access Session-Oriented Services

Arnaud Becart ip- label 11/9/11

THE PROXY SERVER 1 1 PURPOSE 3 2 USAGE EXAMPLES 4 3 STARTING THE PROXY SERVER 5 4 READING THE LOG 6

Perl/CGI. CS 299 Web Programming and Design

Transcription:

CGI Facilitating interactive web applications

Outline In Informatics 1, worksheet 7 says You will learn more about CGI and forms if you enroll in Informatics 2. Now we make good on that promise. First we look at the Hypertext Transfer Protocol (HTTP). Then we consider the Common Gateway Interface (CGI). In the following lectures we will consider cookies and HTML forms.

Hypertext Transfer Protocol (HTTP) One of many protocols for the transfer of data on the Internet. Emerged in the early 1990s, and has gone through a couple revisions. Version 1.1 appears to the be the most popular version in use today. Originally intended for transmission of hypertext documents (text with links). Now used (or abused) for a wide variety of media (video, audio, web apps). Supplanted the gopher protocol, and reduced the significance of others, such as ftp (file transfer) and nntp (news groups).

Client-Server Architecture IE / Windows Client 1 Client 2 Safari / OSX HTTP Request HTTP Response HTTP Request HTTP Response Server Apache / Linux

telnet www.theage.com.au 80 Trying 203.26.51.71... Connected to theage.com.au. Escape character is '^]'. GET /index.html HTTP/1.0 Demonstration of HTTP using the Unix command telnet. Black text is typed input from the user. Red text is output from the telnet program. Green text is output from the web server. HTTP/1.1 302 Found Date: Sat, 06 Sep 2008 04:35:48 GMT Server: Apache Location: http://www.fairfax.com.au Content-Length: 209 Connection: close Content-Type: text/html; charset=iso-8859-1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>302 Found</title> </head><body> <h1>found</h1> <p>the document has moved <a href="http://www.fairfax.com.au">here</a>.</p> </body></html> Connection closed by foreign host.

unix> telnet www.theage.com.au 80 Trying 203.26.51.71... Connected to theage.com.au. Escape character is '^]'. GET /index.html HTTP/1.0 Connect to port 80 on the server. HTTP/1.1 302 Found Date: Sat, 06 Sep 2008 04:35:48 GMT Server: Apache Location: http://www.fairfax.com.au Content-Length: 209 Connection: close Content-Type: text/html; charset=iso-8859-1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>302 Found</title> </head><body> <h1>found</h1> <p>the document has moved <a href="http://www.fairfax.com.au">here</a>.</p> </body></html> Connection closed by foreign host.

unix> telnet www.theage.com.au 80 Trying 203.26.51.71... Connected to theage.com.au. Escape character is '^]'. GET /index.html HTTP/1.0 Request a document from the server, using version 1.0 of HTTP protocol. HTTP/1.1 302 Found Date: Sat, 06 Sep 2008 04:35:48 GMT Server: Apache Location: http://www.fairfax.com.au Content-Length: 209 Connection: close Content-Type: text/html; charset=iso-8859-1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>302 Found</title> </head><body> <h1>found</h1> <p>the document has moved <a href="http://www.fairfax.com.au">here</a>.</p> </body></html> Connection closed by foreign host.

unix> telnet www.theage.com.au 80 Trying 203.26.51.71... Connected to theage.com.au. Escape character is '^]'. GET /index.html HTTP/1.0 Response from the server, using version 1.1 of the HTTP protocol. HTTP/1.1 302 Found Date: Sat, 06 Sep 2008 04:35:48 GMT Server: Apache Location: http://www.fairfax.com.au Content-Length: 209 Connection: close Content-Type: text/html; charset=iso-8859-1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>302 Found</title> </head><body> <h1>found</h1> <p>the document has moved <a href="http://www.fairfax.com.au">here</a>.</p> </body></html> Connection closed by foreign host.

unix> telnet www.theage.com.au 80 Trying 203.26.51.71... Connected to theage.com.au. Escape character is '^]'. GET /index.html HTTP/1.0 Status code. 302 means redirect to another URI (slight abuse of the standard). HTTP/1.1 302 Found Date: Sat, 06 Sep 2008 04:35:48 GMT Server: Apache Location: http://www.fairfax.com.au Content-Length: 209 Connection: close Content-Type: text/html; charset=iso-8859-1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>302 Found</title> </head><body> <h1>found</h1> <p>the document has moved <a href="http://www.fairfax.com.au">here</a>.</p> </body></html> Connection closed by foreign host.

unix> telnet www.theage.com.au 80 Trying 203.26.51.71... Connected to theage.com.au. Escape character is '^]'. GET /index.html HTTP/1.0 Response headers HTTP/1.1 302 Found Date: Sat, 06 Sep 2008 04:35:48 GMT Server: Apache Location: http://www.fairfax.com.au Content-Length: 209 Connection: close Content-Type: text/html; charset=iso-8859-1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>302 Found</title> </head><body> <h1>found</h1> <p>the document has moved <a href="http://www.fairfax.com.au">here</a>.</p> </body></html> Connection closed by foreign host.

unix> telnet www.theage.com.au 80 Trying 203.26.51.71... Connected to theage.com.au. Escape character is '^]'. GET /index.html HTTP/1.0 MIME type. Tells the client what kind of entity appears in the body of the response. HTTP/1.1 302 Found Date: Sat, 06 Sep 2008 04:35:48 GMT Server: Apache Location: http://www.fairfax.com.au Content-Length: 209 Connection: close Content-Type: text/html; charset=iso-8859-1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>302 Found</title> </head><body> <h1>found</h1> <p>the document has moved <a href="http://www.fairfax.com.au">here</a>.</p> </body></html> Connection closed by foreign host.

unix> telnet www.theage.com.au 80 Trying 203.26.51.71... Connected to theage.com.au. Escape character is '^]'. GET /index.html HTTP/1.0 HTTP request and response headers are terminated by a blank line. HTTP/1.1 302 Found Date: Sat, 06 Sep 2008 04:35:48 GMT Server: Apache Location: http://www.fairfax.com.au Content-Length: 209 Connection: close Content-Type: text/html; charset=iso-8859-1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>302 Found</title> </head><body> <h1>found</h1> <p>the document has moved <a href="http://www.fairfax.com.au">here</a>.</p> </body></html> Connection closed by foreign host.

unix> telnet www.theage.com.au 80 Trying 203.26.51.71... Connected to theage.com.au. Escape character is '^]'. GET /index.html HTTP/1.0 Response body (HTML). HTTP/1.1 302 Found Date: Sat, 06 Sep 2008 04:35:48 GMT Server: Apache Location: http://www.fairfax.com.au Content-Length: 209 Connection: close Content-Type: text/html; charset=iso-8859-1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>302 Found</title> </head><body> <h1>found</h1> <p>the document has moved <a href="http://www.fairfax.com.au">here</a>.</p> </body></html> Connection closed by foreign host.

unix> telnet www.theage.com.au 80 Trying 203.26.51.71... Connected to theage.com.au. Escape character is '^]'. GET /index.html HTTP/1.0 Connection to server closed. HTTP/1.1 302 Found Date: Sat, 06 Sep 2008 04:35:48 GMT Server: Apache Location: http://www.fairfax.com.au Content-Length: 209 Connection: close Content-Type: text/html; charset=iso-8859-1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>302 Found</title> </head><body> <h1>found</h1> <p>the document has moved <a href="http://www.fairfax.com.au">here</a>.</p> </body></html> Connection closed by foreign host.

HTTP is very simple GET - retrieve an entity (document) from the server. POST - submit data to the server (usually via an HTML form) for processing. PUT - send an entity to be stored on the server. DELETE - request the removal of an entity from the server. OPTIONS - ask the server to reveal its capabilities. HEAD - same as GET but only return HTTP headers and not the document. http://www.ietf.org/rfc/rfc2616.txt for more details.

The Common Gateway Interface (CGI) A standard method which allows the server to construct a dynamic web page (or other entity) in response to a request from a client. The dynamic content is created by a program running on the server, often called a CGI script. The URI for the requested content identifies the name of the CGI script to use. The server locates the CGI script, executes it (possibly with some additional input sent from the client), and sends the output of the script back to the client. The script can be implemented in any programming language (even compiled languages).

Input to CGI scripts CGI scripts are executed on behalf of the web server. The server initialises special environment variables to communicate information to the CGI script. Environment variables are provided by the operating system. Post information is given to the script via the standard input device (stdin). This design reflects the Unix roots of CGI (and the web in general).

#!/opt/local/bin/python2.5 # A Python CGI program which prints out its environment variables, # and the contents of stdin. import os import sys print 'Content-Type: text/plain' print for var in os.environ: print '%s = %s' % (var, os.environ[var]) print 'stdin = %s' % sys.stdin.read()

#!/opt/local/bin/python2.5 # A Python CGI program which prints out its environment variables, # and the contents of stdin. import os import sys print 'Content-Type: text/plain' print Tells the operating system how to execute this script. System dependent. Not needed on IVLE. for var in os.environ: print '%s = %s' % (var, os.environ[var]) print 'stdin = %s' % sys.stdin.read()

#!/opt/local/bin/python2.5 # A Python CGI program which prints out its environment variables, # and the contents of stdin. import os import sys print 'Content-Type: text/plain' print for var in os.environ: print '%s = %s' % (var, os.environ[var]) print 'stdin = %s' % sys.stdin.read() Partial HTTP response header (just the MIME type). Server will fill in the rest for us. Note the blank line to indicate the end of the header.

#!/opt/local/bin/python2.5 # A Python CGI program which prints out its environment variables, # and the contents of stdin. import os import sys print 'Content-Type: text/plain' print for var in os.environ: print '%s = %s' % (var, os.environ[var]) print 'stdin = %s' % sys.stdin.read() Generate dynamic (text) output which is sent back to the client as response body. Print the contents of the standard input for the script. Print the value of each environment variable.

CGI environment variables on IVLE The previous Python script is served on IVLE at the address: http://students.informatics.unimelb.edu.au/~bjpope/info2/mywork/lectures/cgi/env.py We can examine its output by loading it in a web browser (say Firefox). This will show us the values of all the environment variables available to the script when it is run by the web server on IVLE. You would see similar behaviour on other web servers, but some of the values of the environment variables will be different.

SERVER_SOFTWARE = IVLE/0.1 SCRIPT_NAME = /~bjpope/info2/mywork/lectures/cgi/env.py SERVER_SIGNATURE = <address>apache/2.2.8 (Ubuntu) DAV/2 SVN/1.4.6 mod_python/3.3.1... REQUEST_METHOD = GET HTTP_KEEP_ALIVE = 300 SERVER_PROTOCOL = HTTP/1.1 QUERY_STRING = HOME = /home/bjpope HTTP_ACCEPT_CHARSET = ISO-8859-1,utf-8;q=0.7,*;q=0.7 HTTP_USER_AGENT = Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-gb; rv:1.9.0.1) Gecko/2008070206 Firefox/3.0.1 HTTP_CONNECTION = keep-alive SERVER_NAME = students.informatics.unimelb.edu.au REMOTE_ADDR = 128.250.190.211 PATH_TRANSLATED = /home/bjpope/info2/cgi-lecture/env.py SERVER_PORT = 80 SERVER_ADDR = 128.250.190.210 SERVER_ADMIN = ivle-sysadmin@informatics.unimelb.edu.au HTTP_HOST = students.informatics.unimelb.edu.au REQUEST_URI = /serve/bjpope/info2/cgi-lecture/env.py HTTP_ACCEPT = text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 GATEWAY_INTERFACE = CGI/1.1 HTTP_X_FORWARDED_FOR = 59.167.64.206 REMOTE_PORT = 60609 HTTP_ACCEPT_LANGUAGE = en-gb,en;q=0.5 REMOTE_HOST = 128.250.190.211 HTTP_ACCEPT_ENCODING = gzip,deflate PATH_INFO = stdin =

SERVER_SOFTWARE = IVLE/0.1 SCRIPT_NAME = /~bjpope/info2/mywork/lectures/cgi/env.py SERVER_SIGNATURE = <address>apache/2.2.8 (Ubuntu) DAV/2 SVN/1.4.6 mod_python/3.3.1... REQUEST_METHOD = GET HTTP_KEEP_ALIVE = 300 SERVER_PROTOCOL = HTTP/1.1 QUERY_STRING = HOME = /home/bjpope HTTP_ACCEPT_CHARSET = ISO-8859-1,utf-8;q=0.7,*;q=0.7 The QUERY_STRING variable, and the standard input are the two key places where the script receives input from the client (via the server). In this example they are empty. HTTP_USER_AGENT = Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-gb; rv:1.9.0.1) Gecko/2008070206 Firefox/3.0.1 HTTP_CONNECTION = keep-alive SERVER_NAME = students.informatics.unimelb.edu.au REMOTE_ADDR = 128.250.190.211 PATH_TRANSLATED = /home/bjpope/info2/cgi-lecture/env.py SERVER_PORT = 80 SERVER_ADDR = 128.250.190.210 SERVER_ADMIN = ivle-sysadmin@informatics.unimelb.edu.au HTTP_HOST = students.informatics.unimelb.edu.au REQUEST_URI = /serve/bjpope/info2/cgi-lecture/env.py HTTP_ACCEPT = text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 GATEWAY_INTERFACE = CGI/1.1 HTTP_X_FORWARDED_FOR = 59.167.64.206 REMOTE_PORT = 60609 HTTP_ACCEPT_LANGUAGE = en-gb,en;q=0.5 REMOTE_HOST = 128.250.190.211 HTTP_ACCEPT_ENCODING = gzip,deflate PATH_INFO = stdin =

Sending input via the query string A query string is everything in a URL to the right of the question mark character: http://foo.bar.com/somescript.py?name=james+bond&mission=top+secret Look what happens when we open this (long) URL in Firefox: http://students.informatics.unimelb.edu.au/~bjpope/info2/mywork/lectures/cgi/env.py? name=james+bond&mission=top+secret

SERVER_SOFTWARE = IVLE/0.1 SCRIPT_NAME = /~bjpope/info2/mywork/lectures/cgi/env.py SERVER_SIGNATURE = <address>apache/2.2.8 (Ubuntu) DAV/2 SVN/1.4.6 mod_python/3.3.1... REQUEST_METHOD = GET HTTP_KEEP_ALIVE = 300 SERVER_PROTOCOL = HTTP/1.1 QUERY_STRING = name=james+bond&mission=top+secret HOME = /home/bjpope HTTP_ACCEPT_CHARSET = ISO-8859-1,utf-8;q=0.7,*;q=0.7 HTTP_USER_AGENT = Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-gb; rv:1.9.0.1) Gecko/2008070206 Firefox/3.0.1 HTTP_CONNECTION = keep-alive SERVER_NAME = students.informatics.unimelb.edu.au REMOTE_ADDR = 128.250.190.211 PATH_TRANSLATED = /home/bjpope/info2/cgi-lecture/env.py SERVER_PORT = 80 SERVER_ADDR = 128.250.190.210 SERVER_ADMIN = ivle-sysadmin@informatics.unimelb.edu.au HTTP_HOST = students.informatics.unimelb.edu.au REQUEST_URI = /serve/bjpope/info2/cgi-lecture/env.py HTTP_ACCEPT = text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 GATEWAY_INTERFACE = CGI/1.1 HTTP_X_FORWARDED_FOR = 59.167.64.206 REMOTE_PORT = 60609 HTTP_ACCEPT_LANGUAGE = en-gb,en;q=0.5 REMOTE_HOST = 128.250.190.211 HTTP_ACCEPT_ENCODING = gzip,deflate PATH_INFO = stdin =

Special characters in the query string The query string can contain characters which have special meaning, e.g.? & : + % (and whitespace characters). To include such characters in the query string, they must be encoded. The usual way of encoding special characters is to use a hexadecimal number representing the code of the character (though whitespace is encoded as + ). For instance:? is encoded as %3F. The percent sign tells us that the next two characters are hexadecimal encoding numbers. 3F is hexadecimal for sixty three, which is the ASCII code for?

Sending input via stdin The CGI script receives input via stdin (the standard input device) when the client sends a POST request (instead of a GET request). The POST method sends the data in the body of the request. The GET method sends the data in the header of the request, as part of the URL (as the query string). There are pros and cons of both approaches. We will get back to the POST request when we see HTML forms in the next lecture.

Accessing the CGI input in a systematic way We could just look inside the QUERY_STRING variable and stdin. Troublesome to have to look in both places all the time. If we are receiving input from a HTML form, then the input data is structured like so: name1=value1&name2=value2&name3=value3 where name1, name2, name3 represent input items in the form. It is tedious to deal with the unstructured representation as an encoded string.

#!/opt/local/bin/python2.5 # A Python CGI program which demonstrates the use of FieldStorage import cgi print 'Content-Type: text/plain' print store = cgi.fieldstorage() for var in store: print "%s = %s" % (var, store.getvalue(var))

#!/opt/local/bin/python2.5 # A Python CGI program which demonstrates the use of FieldStorage import cgi print 'Content-Type: text/plain' print store = cgi.fieldstorage() for var in store: print "%s = %s" % (var, store.getvalue(var)) This function reads the QUERY_STRING and stdin, decodes them, and parses each ʻname=valueʼ entry. It builds a data structure which behaves like a dictionary, mapping each ʻnameʼ to its corresponding ʻvalueʼ.

cgi.fieldstorage in Python The previous Python script is served on IVLE at the address: http://students.informatics.unimelb.edu.au/~bjpope/info2/mywork/lectures/cgi/ fieldstore.py Consider what happens when we request that URL with the query string name=james+bond&mission=top+secret We get the output: name = James Bond mission = top secret