Example of Calling An Application
An example of calling an application and retrieving its response:
def call_application(app, environ): body = status_headers = def start_response(status, headers): status_headers = return body.append app_iter = app(environ, start_response) try: for item in app_iter: body.append(item) finally: if hasattr(app_iter, 'close'): app_iter.close return status_headers, status_headers, ''.join(body) status, headers, body = call_application(app, {...environ...})Read more about this topic: Web Server Gateway Interface
Famous quotes containing the words calling and/or application:
“Every man who has at last succeeded, after long effort, in calling up the divinity which lies hidden in a womans heart, is startled to find that he must obey the God he summoned.”
—Henry Brooks Adams (18381918)
“It is known that Whistler when asked how long it took him to paint one of his nocturnes answered: All of my life. With the same rigor he could have said that all of the centuries that preceded the moment when he painted were necessary. From that correct application of the law of causality it follows that the slightest event presupposes the inconceivable universe and, conversely, that the universe needs even the slightest of events.”
—Jorge Luis Borges (18991986)