Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#coding:utf-8
import cgi
def application(environ, start_response):
fs = cgi.FieldStorage(environ=environ, fp=environ['wsgi.input'])
value = fs.getfirst('val', 'Python')
status = '200 OK'
response_headers = [('Content-type', 'text/plain')]
start_response(status, response_headers)
yield 'こんにちは {0}\n'.format(value)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment