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 lived for fifty years has buried a whole world or even two; he has grown used to its disappearance and accustomed to the new scenery of another act: but suddenly the names and faces of a time long dead appear more and more often on his way, calling up series of shades and pictures kept somewhere, just in case in the endless catacombs of the memory, making him smile or sigh, and sometimes almost weep.”
—Alexander Herzen (18121870)
“There are very few things impossible in themselves; and we do not want means to conquer difficulties so much as application and resolution in the use of means.”
—François, Duc De La Rochefoucauld (16131680)