:mod:`cgi` --- Common Gateway Interface support
===============================================
.. module:: cgi
:synopsis: Helpers for running Python scripts via the Common Gateway Interface.
:deprecated:
**Source code:** :source:`Lib/cgi.py`
.. index::
pair: WWW; server
pair: CGI; protocol
pair: HTTP; protocol
pair: MIME; headers
single: URL
single: Common Gateway Interface
.. deprecated-removed:: 3.11 3.13
The :mod:`cgi` module is deprecated
(see :pep:`PEP 594 <594#cgi>` for details and alternatives).
The :class:`FieldStorage` class can typically be replaced with
:func:`urllib.parse.parse_qsl` for ``GET`` and ``HEAD`` requests,
and the :mod:`email.message` module or
`multipart `_ for ``POST`` and ``PUT``.
Most :ref:`utility functions ` have replacements.
--------------
Support module for Common Gateway Interface (CGI) scripts.
This module defines a number of utilities for use by CGI scripts written in
Python.
The global variable ``maxlen`` can be set to an integer indicating the maximum
size of a POST request. POST requests larger than this size will result in a
:exc:`ValueError` being raised during parsing. The default value of this
variable is ``0``, meaning the request size is unlimited.
.. include:: ../includes/wasm-notavail.rst
Introduction
------------
.. _cgi-intro:
A CGI script is invoked by an HTTP server, usually to process user input
submitted through an HTML ``