Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Selected Reading
CGI Articles
Page 2 of 2
What Content-type is required to write Python CGI program?
When writing Python CGI programs, you must specify a Content-type header to tell the browser how to interpret the response. This is essential for proper web communication between your CGI script and the client's browser. Basic Content-type Header The first line of any CGI program output must be a Content-type header followed by a blank line ‒ #!/usr/bin/env python3 print("Content-type: text/html\r\r") print("") print("Hello CGI") print("") print("Hello from Python CGI!") print("") print("") Why the Content-type Header is Required The Content-type header tells the browser: What type of content to expect (HTML, ...
Read MoreAdvertisements