Skip to content

Instantly share code, notes, and snippets.

@jz5
Created May 27, 2014 18:50
Show Gist options
  • Save jz5/25a23cd56d7c8cca139a to your computer and use it in GitHub Desktop.
Save jz5/25a23cd56d7c8cca139a to your computer and use it in GitHub Desktop.
#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