Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: bfc3aba5e7
Fetching contributors…

Cannot retrieve contributors at this time

36 lines (25 sloc) 0.947 kB
from .request import Request
def receive_wsgi_req(environ, start_response):
request = Request.parse_wsgi_request(environ)
return [request]
class WSGIConnection(object):
"""This class defines request handling methods for wsgi implimentations."""
def __init__(self):
pass
def recv(self):
"""Receives the request from the wsgi server."""
pass
if __name__ == "__main__":
from wsgiref.util import setup_testing_defaults
from wsgiref.simple_server import make_server
def simple_app(environ, start_response):
setup_testing_defaults(environ)
status = '200 OK'
headers = [('Content-type', 'text/plain')]
start_response(status, headers)
ret = ["%s: %s\n" % (key, value)
for key, value in environ.iteritems()]
return ret
httpd = make_server('', 8000, simple_app)
print "Serving on port 8000..."
httpd.serve_forever()
Jump to Line
Something went wrong with that request. Please try again.