/gist:021203cab26c9e4b0baf Secret
Created
December 10, 2013 16:40
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
# Our tutorial's WSGI server | |
from wsgiref.simple_server import make_server | |
def application(environ, start_response): | |
# Sorting and stringifying the environment key, value pairs | |
response_body = ['%s: %s' % (key, value) | |
for key, value in sorted(environ.items())] | |
response_body = '\n'.join(response_body) | |
status = '200 OK' | |
response_headers = [('Content-Type', 'text/plain'), | |
('Content-Length', str(len(response_body)))] | |
start_response(status, response_headers) | |
return [response_body] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment