In PHP you can just use $_POST
for POST and $_GET
for GET (Query string) variables. What\'s the equivalent in Python?
I've found nosklo's answer very extensive and useful! For those, like myself, who might find accessing the raw request data directly also useful, I would like to add the way to do that:
import os, sys
# the query string, which contains the raw GET data
# (For example, for http://example.com/myscript.py?a=b&c=d&e
# this is "a=b&c=d&e")
os.getenv("QUERY_STRING")
# the raw POST data
sys.stdin.read()