CGI

From Omnia
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Content Type

Start all HTML output with:

# bash:
echo -e "Content-Type: text/html\n"
# Python:
print("Content-Type: text/html\n")

If you want just text output:

echo -e "Content-Type: text/plain\n"
print("Content-Type: text/plain\n")

404

Python:

print("Status: 404 Not Found\n\n")
sys.exit(0)

keywords