Returns the final WSGI response as tuple. The first item in the tuple is the application iterator, the second the status and the third the list of headers. The response returned is created specially for the given environment. For example if the request method in th
(
self, environ: WSGIEnvironment
)
| 545 | return ClosingIterator(iterable, self.close) |
| 546 | |
| 547 | def get_wsgi_response( |
| 548 | self, environ: WSGIEnvironment |
| 549 | ) -> tuple[t.Iterable[bytes], str, list[tuple[str, str]]]: |
| 550 | """Returns the final WSGI response as tuple. The first item in |
| 551 | the tuple is the application iterator, the second the status and |
| 552 | the third the list of headers. The response returned is created |
| 553 | specially for the given environment. For example if the request |
| 554 | method in the WSGI environment is ``'HEAD'`` the response will |
| 555 | be empty and only the headers and status code will be present. |
| 556 | |
| 557 | .. versionadded:: 0.6 |
| 558 | |
| 559 | :param environ: the WSGI environment of the request. |
| 560 | :return: an ``(app_iter, status, headers)`` tuple. |
| 561 | """ |
| 562 | headers = self.get_wsgi_headers(environ) |
| 563 | app_iter = self.get_app_iter(environ) |
| 564 | return app_iter, self.status, headers.to_wsgi_list() |
| 565 | |
| 566 | def __call__( |
| 567 | self, environ: WSGIEnvironment, start_response: StartResponse |