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:
“There are those who scoff at the schoolboy, calling him frivolous and shallow. Yet it was the schoolboy who said Faith is believing what you know aint so.”
—Mark Twain [Samuel Langhorne Clemens] (18351910)
“I conceive that the leading characteristic of the nineteenth century has been the rapid growth of the scientific spirit, the consequent application of scientific methods of investigation to all the problems with which the human mind is occupied, and the correlative rejection of traditional beliefs which have proved their incompetence to bear such investigation.”
—Thomas Henry Huxley (182595)