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.wrappers.Request`.
Parameters | |
method | The method the request was made with, such as GET. |
scheme | The URL scheme of the protocol the request used, such as https or wss. |
server | The address of the server. (host, port), (path, None) for unix sockets, or None if not known. |
root_path | The prefix that the application is mounted under. This is prepended to generated URLs, but is not part of route matching. |
path | The path part of the URL after root_path. |
query_string | The part of the URL after the "?". |
headers | The headers received with the request. |
remote_addr | The address of the client sending the request. |
Method | __init__ |
Undocumented |
Method | __repr__ |
Undocumented |
Class Variable | access_control_request_headers |
Undocumented |
Class Variable | access_control_request_method |
Undocumented |
Class Variable | charset |
Undocumented |
Class Variable | content_encoding |
Undocumented |
Class Variable | content_md5 |
Undocumented |
Class Variable | content_type |
Undocumented |
Class Variable | date |
Undocumented |
Class Variable | encoding_errors |
Undocumented |
Class Variable | max_forwards |
Undocumented |
Class Variable | origin |
Undocumented |
Class Variable | referrer |
Undocumented |
Class Variable | trusted_hosts |
Undocumented |
Instance Variable | headers |
Undocumented |
Instance Variable | method |
Undocumented |
Instance Variable | path |
Undocumented |
Instance Variable | query_string |
Undocumented |
Instance Variable | remote_addr |
Undocumented |
Instance Variable | root_path |
Undocumented |
Instance Variable | scheme |
Undocumented |
Instance Variable | server |
Undocumented |
Property | accept_charsets |
List of charsets this client supports as ~werkzeug.datastructures.CharsetAccept object. |
Property | accept_encodings |
List of encodings this client accepts. Encodings in a HTTP term are compression encodings such as gzip. For charsets have a look at accept_charset . |
Property | accept_languages |
List of languages this client accepts as ~werkzeug.datastructures.LanguageAccept object. |
Property | accept_mimetypes |
List of mimetypes this client supports as ~werkzeug.datastructures.MIMEAccept object. |
Property | access_route |
If a forwarded header exists this is a list of all ip addresses from the client ip to the last proxy server. |
Property | args |
The parsed URL parameters (the part in the URL after the question mark). |
Property | authorization |
The Authorization object in parsed form. |
Property | base_url |
Like url but without the query string. |
Property | cache_control |
A ~werkzeug.datastructures.RequestCacheControl object for the incoming cache control headers. |
Property | content_length |
No summary |
Property | cookies |
A dict with the contents of all cookies transmitted with the request. |
Property | full_path |
Requested path, including the query string. |
Property | host |
The host name the request was made to, including the port if it's non-standard. Validated with trusted_hosts . |
Property | host_url |
The request URL scheme and host only. |
Property | if_match |
An object containing all the etags in the If-Match header. |
Property | if_modified_since |
The parsed If-Modified-Since header as a datetime object. |
Property | if_none_match |
An object containing all the etags in the If-None-Match header. |
Property | if_range |
The parsed If-Range header. |
Property | if_unmodified_since |
The parsed If-Unmodified-Since header as a datetime object. |
Property | is_json |
Check if the mimetype indicates JSON data, either :mimetype:`application/json` or :mimetype:`application/*+json`. |
Property | is_secure |
True if the request was made with a secure protocol (HTTPS or WSS). |
Property | mimetype |
No summary |
Property | mimetype_params |
The mimetype parameters as dict. For example if the content type is text/html; charset=utf-8 the params would be {'charset': 'utf-8'}. |
Property | pragma |
No summary |
Property | range |
The parsed Range header. |
Property | root_url |
The request URL scheme, host, and root path. This is the root that the application is accessed from. |
Property | url |
The full request URL with the scheme, host, root path, path, and query string. |
Property | url_charset |
The charset that is assumed for URLs. Defaults to the value of charset . |
Property | user_agent |
No summary |
Method | _parse_content_type |
Undocumented |
Instance Variable | _parsed_content_type |
Undocumented |
werkzeug.wrappers.request.Request
Undocumented
Parameters | |
method:str | Undocumented |
scheme:str | Undocumented |
server:t.Optional[ | Undocumented |
root_path:str | Undocumented |
path:str | Undocumented |
query_string:bytes | Undocumented |
headers:Headers | Undocumented |
remote_addr:t.Optional[ | Undocumented |
accept_charset
.The parsed URL parameters (the part in the URL after the question mark).
By default an
~werkzeug.datastructures.ImmutableMultiDict
is returned from this function. This can be changed by setting
parameter_storage_class
to a different type. This might
be necessary if the order of the form data is important.
trusted_hosts
.The parsed If-Modified-Since
header as a datetime object.
The parsed If-Range header.
The parsed If-Unmodified-Since
header as a datetime object.
bool
=
str
=
content_type
, but without parameters (eg, without
charset, type etc.) and always lowercase. For example if the content
type is text/HTML; charset=utf-8 the mimetype would be
'text/html'.t.Dict[ str, str]
=
str
=
The charset that is assumed for URLs. Defaults to the value
of charset
.
The user agent. Use user_agent.string to get the header
value. Set user_agent_class
to a subclass of
~werkzeug.user_agent.UserAgent
to provide parsing for
the other properties or other extended data.