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

Method __init__

src/werkzeug/wrappers/request.py:113–133  ·  view source on GitHub ↗
(
        self,
        environ: WSGIEnvironment,
        populate_request: bool = True,
        shallow: bool = False,
    )

Source from the content-addressed store, hash-verified

111 shallow: bool
112
113 def __init__(
114 self,
115 environ: WSGIEnvironment,
116 populate_request: bool = True,
117 shallow: bool = False,
118 ) -> None:
119 super().__init__(
120 method=environ.get("REQUEST_METHOD", "GET"),
121 scheme=environ.get("wsgi.url_scheme", "http"),
122 server=_get_server(environ),
123 root_path=_wsgi_decoding_dance(environ.get("SCRIPT_NAME") or ""),
124 path=_wsgi_decoding_dance(environ.get("PATH_INFO") or ""),
125 query_string=environ.get("QUERY_STRING", "").encode("latin1"),
126 headers=EnvironHeaders(environ),
127 remote_addr=environ.get("REMOTE_ADDR"),
128 )
129 self.environ = environ
130 self.shallow = shallow
131
132 if populate_request and not shallow:
133 self.environ["werkzeug.request"] = self
134
135 @classmethod
136 def from_values(cls, *args: t.Any, **kwargs: t.Any) -> Request:

Callers

nothing calls this directly

Calls 4

_get_serverFunction · 0.85
_wsgi_decoding_danceFunction · 0.85
EnvironHeadersClass · 0.85
getMethod · 0.45

Tested by

no test coverage detected