Found 13 Articles for CGI

What are important HTTP headers to be frequently used in Python CGI Programming?

Rajendra Dharmkar
Updated on 16-Jun-2020 12:25:28

246 Views

HTTP HeaderThe line Content-type:text/html\r\r is part of HTTP header which is sent to the browser to understand the content. All the HTTP header will be in the following form −HTTP Field Name − Field ContentFor ExampleContent-type − text/html\r\rThere are few other important HTTP headers, which we will use frequently in our CGI Programming.     Sr.No.HeaderDescription1Content-type:A MIME string defining the format of the file being returned. Example is Content-type:text/html2Expires: DateThe date the information becomes invalid. It is used by the browser to decide when a page needs to be refreshed. A valid date string is in the format 01 Jan 1998 ... Read More

What Content-type is required to write Python CGI program?

Rajendra Dharmkar
Updated on 30-Jul-2019 22:30:21

247 Views

If we run simple scripts like hello.py, its output is written on the STDOUT file, i.e., screen. There is one important and extra feature available which is the first line to be printed Content-type:text/html\r\r. This line is sent back to the browser and it specifies the content type to be displayed on the browser screen.We can write advanced CGI programs using Python. This script can interact with any other external system and even exchange information with RDBMS.

What are the modules required for CGI programming in Python?

Rajendra Dharmkar
Updated on 16-Jun-2020 12:21:40

136 Views

Python's cgi module is usually the starting place in writing CGI programs in Python. The main purpose of the cgi module is to extract the values passed to a CGI program from an HTML form. Mostly one interacts with CGI applications through an HTML form. One fills out some values in the form that specify details of the action to be performed, then call on the CGI to perform its action using your specifications.You may include many input fields within an HTML form which can be of a number of different types (text, checkboxes, picklists, radio buttons, etc.).Your Python script ... Read More

Advertisements