def application(environ, start_response):
    if environ['REQUEST_METHOD']!='GET':
        start_response('301 Redirect', [('Location',  http://example.com'),])
        return []
    response_headers = [
        ('Content-Length', str(len(output))),
        ('Content-Type', 'text/plain'),
    ]
    start_response('200 OK', response_headers)
    return ["Hello World"]
 
No comments:
Post a Comment