datadb-scripts/test
2017-05-27 12:08:31 -07:00

26 lines
553 B
Python
Executable File

#!/usr/bin/env python3
import os
from urllib.parse import parse_qs
def start_response(content_type="text/html", status_code=("200", "OK",)):
print('Status: %s %s' % (status_code))
print("Content-Type: %s" % content_type)
print()
if __name__ == "__main__":
try:
data = parse_qs(os.environ["QUERY_STRING"])
assert "yo" in data
start_response()
print("you passed: ?yo=%s" % data["yo"][0])
except Exception as e:
start_response(status_code=('500', "you fucked up"))
print(str(e))