Skip to content

Instantly share code, notes, and snippets.

@siongui
Created December 4, 2013 04:09
Show Gist options
  • Save siongui/7782204 to your computer and use it in GitHub Desktop.
Save siongui/7782204 to your computer and use it in GitHub Desktop.
WSGI 简单服务器请求 From: http://my.oschina.net/u/260264/blog/181255
# -*- encodeing:utf-8 -*-
from wsgiref.simple_server import make_server
def simple_app(environ, start_response):
status = '200 OK'
response_headers = [('Content-type', 'text/plain')]
start_response(status, response_headers)
return [u"This is hello wsgi app".encode('utf8')]
httpd = make_server('', 8000, simple_app)
print "Serving on port 8000..."
httpd.serve_forever()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment