CGI

From Omnia
Revision as of 03:39, 3 October 2023 by Kenneth (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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