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

Function create_environ

src/werkzeug/test.py:1203–1223  ·  view source on GitHub ↗

Create a new WSGI environ dict based on the values passed. The first parameter should be the path of the request which defaults to '/'. The second one can either be an absolute path (in that case the host is localhost:80) or a full path to the request with scheme, netloc port and t

(*args: t.Any, **kwargs: t.Any)

Source from the content-addressed store, hash-verified

1201
1202
1203def create_environ(*args: t.Any, **kwargs: t.Any) -> WSGIEnvironment:
1204 """Create a new WSGI environ dict based on the values passed. The first
1205 parameter should be the path of the request which defaults to '/'. The
1206 second one can either be an absolute path (in that case the host is
1207 localhost:80) or a full path to the request with scheme, netloc port and
1208 the path to the script.
1209
1210 This accepts the same arguments as the :class:`EnvironBuilder`
1211 constructor.
1212
1213 .. versionchanged:: 0.5
1214 This function is now a thin wrapper over :class:`EnvironBuilder` which
1215 was added in 0.5. The `headers`, `environ_base`, `environ_overrides`
1216 and `charset` parameters were added.
1217 """
1218 builder = EnvironBuilder(*args, **kwargs)
1219
1220 try:
1221 return builder.get_environ()
1222 finally:
1223 builder.close()
1224
1225
1226def run_wsgi_app(

Calls 3

get_environMethod · 0.95
closeMethod · 0.95
EnvironBuilderClass · 0.85

Tested by

no test coverage detected