Represents the non-IO parts of a HTTP request, including the method, URL info, and headers. This class is not meant for general use. It should only be used when implementing WSGI, ASGI, or another HTTP application spec. Werkzeug provides a WSGI implementation at :cls:`werkzeug.wrapp
| 37 | |
| 38 | |
| 39 | class Request: |
| 40 | """Represents the non-IO parts of a HTTP request, including the |
| 41 | method, URL info, and headers. |
| 42 | |
| 43 | This class is not meant for general use. It should only be used when |
| 44 | implementing WSGI, ASGI, or another HTTP application spec. Werkzeug |
| 45 | provides a WSGI implementation at :cls:`werkzeug.wrappers.Request`. |
| 46 | |
| 47 | :param method: The method the request was made with, such as |
| 48 | ``GET``. |
| 49 | :param scheme: The URL scheme of the protocol the request used, such |
| 50 | as ``https`` or ``wss``. |
| 51 | :param server: The address of the server. ``(host, port)``, |
| 52 | ``(path, None)`` for unix sockets, or ``None`` if not known. |
| 53 | :param root_path: The prefix that the application is mounted under. |
| 54 | This is prepended to generated URLs, but is not part of route |
| 55 | matching. |
| 56 | :param path: The path part of the URL after ``root_path``. |
| 57 | :param query_string: The part of the URL after the "?". |
| 58 | :param headers: The headers received with the request. |
| 59 | :param remote_addr: The address of the client sending the request. |
| 60 | |
| 61 | .. versionchanged:: 3.0 |
| 62 | The ``charset``, ``url_charset``, and ``encoding_errors`` attributes |
| 63 | were removed. |
| 64 | |
| 65 | .. versionadded:: 2.0 |
| 66 | """ |
| 67 | |
| 68 | #: the class to use for `args` and `form`. The default is an |
| 69 | #: :class:`~werkzeug.datastructures.ImmutableMultiDict` which supports |
| 70 | #: multiple values per key. A :class:`~werkzeug.datastructures.ImmutableDict` |
| 71 | #: is faster but only remembers the last key. It is also |
| 72 | #: possible to use mutable structures, but this is not recommended. |
| 73 | #: |
| 74 | #: .. versionadded:: 0.6 |
| 75 | parameter_storage_class: type[MultiDict[str, t.Any]] = ImmutableMultiDict |
| 76 | |
| 77 | #: The type to be used for dict values from the incoming WSGI |
| 78 | #: environment. (For example for :attr:`cookies`.) By default an |
| 79 | #: :class:`~werkzeug.datastructures.ImmutableMultiDict` is used. |
| 80 | #: |
| 81 | #: .. versionchanged:: 1.0.0 |
| 82 | #: Changed to ``ImmutableMultiDict`` to support multiple values. |
| 83 | #: |
| 84 | #: .. versionadded:: 0.6 |
| 85 | dict_storage_class: type[MultiDict[str, t.Any]] = ImmutableMultiDict |
| 86 | |
| 87 | #: the type to be used for list values from the incoming WSGI environment. |
| 88 | #: By default an :class:`~werkzeug.datastructures.ImmutableList` is used |
| 89 | #: (for example for :attr:`access_list`). |
| 90 | #: |
| 91 | #: .. versionadded:: 0.6 |
| 92 | list_storage_class: type[list[t.Any]] = ImmutableList |
| 93 | |
| 94 | user_agent_class: type[UserAgent] = UserAgent |
| 95 | """The class used and returned by the :attr:`user_agent` property to |
| 96 | parse the header. Defaults to |