MCPcopy
hub / github.com/pallets/werkzeug / get_wsgi_response

Method get_wsgi_response

src/werkzeug/wrappers/response.py:547–564  ·  view source on GitHub ↗

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
    )

Source from the content-addressed store, hash-verified

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

Callers 2

__call__Method · 0.95

Calls 3

get_wsgi_headersMethod · 0.95
get_app_iterMethod · 0.95
to_wsgi_listMethod · 0.80