class werkzeug.wrappers.Request(environ, populate_request=True, shallow=False)  
Represents an incoming WSGI HTTP request, with headers and body taken from the WSGI environment. Has properties and methods for using the functionality defined by various HTTP specs. The data in requests object is read-only. Text data is assumed to use UTF-8 encoding, which should be true for the vast majority of modern clients. Using an encoding set by the client is unsafe in Python due to extra encodings it provides, such as zip. To change the assumed encoding, subclass and replace charset.  Parameters 
 
environ (WSGIEnvironment) – The WSGI environ is generated by the WSGI server and contains information about the server configuration and client request. 
populate_request (bool) – Add this request object to the WSGI environ as environ['werkzeug.request']. Can be useful when debugging. 
shallow (bool) – Makes reading from stream (and any method that would read from it) raise a RuntimeError. Useful to prevent consuming the form data in middleware, which would make it unavailable to the final application.   Return type 
None    Changed in version 2.0: Combine BaseRequest and mixins into a single Request class. Using the old classes is deprecated and will be removed in Werkzeug 2.1.   Changelog Changed in version 0.5: Read-only mode is enforced with immutable classes for all data.   
_get_file_stream(total_content_length, content_type, filename=None, content_length=None)  
Called to get a stream for the file upload. This must provide a file-like class with read(), readline() and seek() methods that is both writeable and readable. The default implementation returns a temporary file if the total content length is higher than 500KB. Because many browsers do not provide a content length for the files only the total content length matters.  Parameters 
 
total_content_length (Optional[int]) – the total content length of all the data in the request combined. This value is guaranteed to be there. 
content_type (Optional[str]) – the mimetype of the uploaded file. 
filename (Optional[str]) – the filename of the uploaded file. May be None. 
content_length (Optional[int]) – the length of this file. This value is usually not provided because webbrowsers do not provide this value.   Return type 
BinaryIO   
  
property accept_charsets: werkzeug.datastructures.CharsetAccept  
List of charsets this client supports as CharsetAccept object. 
  
property accept_encodings: werkzeug.datastructures.Accept  
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: werkzeug.datastructures.LanguageAccept  
List of languages this client accepts as LanguageAccept object. 
  
property accept_mimetypes: werkzeug.datastructures.MIMEAccept  
List of mimetypes this client supports as MIMEAccept object. 
  
access_control_request_headers  
Sent with a preflight request to indicate which headers will be sent with the cross origin request. Set access_control_allow_headers on the response to indicate which headers are allowed. 
  
access_control_request_method  
Sent with a preflight request to indicate which method will be used for the cross origin request. Set access_control_allow_methods on the response to indicate which methods are allowed. 
  
property access_route: List[str]  
If a forwarded header exists this is a list of all ip addresses from the client ip to the last proxy server. 
  
classmethod application(f)  
Decorate a function as responder that accepts the request as the last argument. This works like the responder() decorator but the function is passed the request object as the last argument and the request object will be closed automatically: @Request.application
def my_wsgi_app(request):
    return Response('Hello World!')
 As of Werkzeug 0.14 HTTP exceptions are automatically caught and converted to responses instead of failing.  Parameters 
f (Callable[[Request], WSGIApplication]) – the WSGI callable to decorate  Returns 
a new WSGI callable  Return type 
WSGIApplication   
  
property args: MultiDict[str, str]  
The parsed URL parameters (the part in the URL after the question mark). By default an 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. 
  
property authorization: Optional[werkzeug.datastructures.Authorization]  
The Authorization object in parsed form. 
  
property base_url: str  
Like url but without the query string. 
  
property cache_control: werkzeug.datastructures.RequestCacheControl  
A RequestCacheControl object for the incoming cache control headers. 
  
close()  
Closes associated resources of this request object. This closes all file handles explicitly. You can also use the request object in a with statement which will automatically close it.  Changelog New in version 0.9.   Return type 
None   
  
content_encoding  
The Content-Encoding entity-header field is used as a modifier to the media-type. When present, its value indicates what additional content codings have been applied to the entity-body, and thus what decoding mechanisms must be applied in order to obtain the media-type referenced by the Content-Type header field.  Changelog New in version 0.9.  

  
property content_length: Optional[int]  
The Content-Length entity-header field indicates the size of the entity-body in bytes or, in the case of the HEAD method, the size of the entity-body that would have been sent had the request been a GET. 
  
content_md5  
The Content-MD5 entity-header field, as defined in RFC 1864, is an MD5 digest of the entity-body for the purpose of providing an end-to-end message integrity check (MIC) of the entity-body. (Note: a MIC is good for detecting accidental modification of the entity-body in transit, but is not proof against malicious attacks.)  Changelog New in version 0.9.  

  
content_type  
The Content-Type entity-header field indicates the media type of the entity-body sent to the recipient or, in the case of the HEAD method, the media type that would have been sent had the request been a GET. 
  
property cookies: ImmutableMultiDict[str, str]  
A dict with the contents of all cookies transmitted with the request. 
  
property data: bytes  
Contains the incoming request data as string in case it came with a mimetype Werkzeug does not handle. 
  
date  
The Date general-header field represents the date and time at which the message was originated, having the same semantics as orig-date in RFC 822.  Changed in version 2.0: The datetime object is timezone-aware.  
  
dict_storage_class  
alias of werkzeug.datastructures.ImmutableMultiDict 
  
disable_data_descriptor: Optional[bool] = None  
Disable the data property to avoid reading from the input stream.  Deprecated since version 2.0: Will be removed in Werkzeug 2.1. Create the request with shallow=True instead.   Changelog New in version 0.9.  

  
environ: WSGIEnvironment  
The WSGI environment containing HTTP headers and information from the WSGI server. 
  
property files: ImmutableMultiDict[str, FileStorage]  
MultiDict object containing all uploaded files. Each key in files is the name from the <input type="file" name="">. Each value in files is a Werkzeug FileStorage object. It basically behaves like a standard file object you know from Python, with the difference that it also has a save() function that can store the file on the filesystem. Note that files will only contain data if the request method was POST, PUT or PATCH and the <form> that posted to the request had enctype="multipart/form-data". It will be empty otherwise. See the MultiDict / FileStorage documentation for more details about the used data structure. 
  
property form: ImmutableMultiDict[str, str]  
The form parameters. By default an 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. Please keep in mind that file uploads will not end up here, but instead in the files attribute.  Changelog Changed in version 0.9: Previous to Werkzeug 0.9 this would only contain form data for POST and PUT requests.  

  
form_data_parser_class  
alias of werkzeug.formparser.FormDataParser 
  
classmethod from_values(*args, **kwargs)  
Create a new request object based on the values provided. If environ is given missing values are filled from there. This method is useful for small scripts when you need to simulate a request from an URL. Do not use this method for unittesting, there is a full featured client object (Client) that allows to create multipart requests, support for cookies etc. This accepts the same options as the EnvironBuilder.  Changelog Changed in version 0.5: This method now accepts the same arguments as EnvironBuilder. Because of this the environ parameter is now called environ_overrides.   Returns 
request object  Parameters 
 
args (Any) –  
kwargs (Any) –    Return type 
werkzeug.wrappers.request.Request   
  
property full_path: str  
Requested path, including the query string. 
  
get_data(cache=True, as_text=False, parse_form_data=False)  
This reads the buffered incoming data from the client into one bytes object. By default this is cached but that behavior can be changed by setting cache to False. Usually it’s a bad idea to call this method without checking the content length first as a client could send dozens of megabytes or more to cause memory problems on the server. Note that if the form data was already parsed this method will not return anything as form data parsing does not cache the data like this method does. To implicitly invoke form data parsing function set parse_form_data to True. When this is done the return value of this method will be an empty string if the form parser handles the data. This generally is not necessary as if the whole data is cached (which is the default) the form parser will used the cached data to parse the form data. Please be generally aware of checking the content length first in any case before calling this method to avoid exhausting server memory. If as_text is set to True the return value will be a decoded string.  Changelog New in version 0.9.   Parameters 
 
cache (bool) –  
as_text (bool) –  
parse_form_data (bool) –    Return type 
Union[bytes, str]   
  
get_json(force=False, silent=False, cache=True)  
Parse data as JSON. If the mimetype does not indicate JSON (application/json, see is_json()), this returns None. If parsing fails, on_json_loading_failed() is called and its return value is used as the return value.  Parameters 
 
force (bool) – Ignore the mimetype and always try to parse JSON. 
silent (bool) – Silence parsing errors and return None instead. 
cache (bool) – Store the parsed JSON to return for subsequent calls.   Return type 
Optional[Any]   
  
headers  
The headers received with the request. 
  
property host: str  
The host name the request was made to, including the port if it’s non-standard. Validated with trusted_hosts. 
  
property host_url: str  
The request URL scheme and host only. 
  
property if_match: werkzeug.datastructures.ETags  
An object containing all the etags in the If-Match header.  Return type 
ETags   
  
property if_modified_since: Optional[datetime.datetime]  
The parsed If-Modified-Since header as a datetime object.  Changed in version 2.0: The datetime object is timezone-aware.  
  
property if_none_match: werkzeug.datastructures.ETags  
An object containing all the etags in the If-None-Match header.  Return type 
ETags   
  
property if_range: werkzeug.datastructures.IfRange  
The parsed If-Range header.  Changed in version 2.0: IfRange.date is timezone-aware.   Changelog New in version 0.7.  

  
property if_unmodified_since: Optional[datetime.datetime]  
The parsed If-Unmodified-Since header as a datetime object.  Changed in version 2.0: The datetime object is timezone-aware.  
  
input_stream  
The WSGI input stream. In general it’s a bad idea to use this one because you can easily read past the boundary. Use the stream instead. 
  
property is_json: bool  
Check if the mimetype indicates JSON data, either application/json or application/*+json. 
  
is_multiprocess  
boolean that is True if the application is served by a WSGI server that spawns multiple processes. 
  
is_multithread  
boolean that is True if the application is served by a multithreaded WSGI server. 
  
is_run_once  
boolean that is True if the application will be executed only once in a process lifetime. This is the case for CGI for example, but it’s not guaranteed that the execution only happens one time. 
  
property is_secure: bool  
True if the request was made with a secure protocol (HTTPS or WSS). 
  
property json: Optional[Any]  
The parsed JSON data if mimetype indicates JSON (application/json, see is_json()). Calls get_json() with default arguments. 
  
json_module = <module 'json' from '/home/docs/.pyenv/versions/3.7.9/lib/python3.7/json/__init__.py'>  
A module or other object that has dumps and loads functions that match the API of the built-in json module. 
  
list_storage_class  
alias of werkzeug.datastructures.ImmutableList 
  
make_form_data_parser()  
Creates the form data parser. Instantiates the form_data_parser_class with some parameters.  Changelog New in version 0.8.   Return type 
werkzeug.formparser.FormDataParser   
  
max_content_length: Optional[int] = None  
the maximum content length. This is forwarded to the form data parsing function (parse_form_data()). When set and the form or files attribute is accessed and the parsing fails because more than the specified value is transmitted a RequestEntityTooLarge exception is raised. Have a look at Dealing with Request Data for more details.  Changelog New in version 0.5.  

  
max_form_memory_size: Optional[int] = None  
the maximum form field size. This is forwarded to the form data parsing function (parse_form_data()). When set and the form or files attribute is accessed and the data in memory for post data is longer than the specified value a RequestEntityTooLarge exception is raised. Have a look at Dealing with Request Data for more details.  Changelog New in version 0.5.  

  
max_forwards  
The Max-Forwards request-header field provides a mechanism with the TRACE and OPTIONS methods to limit the number of proxies or gateways that can forward the request to the next inbound server. 
  
method  
The method the request was made with, such as GET. 
  
property mimetype: str  
Like 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'. 
  
property mimetype_params: Dict[str, str]  
The mimetype parameters as dict. For example if the content type is text/html; charset=utf-8 the params would be {'charset': 'utf-8'}. 
  
on_json_loading_failed(e)  
Called if get_json() parsing fails and isn’t silenced. If this method returns a value, it is used as the return value for get_json(). The default implementation raises BadRequest.  Parameters 
e (ValueError) –   Return type 
Any   
  
origin  
The host that the request originated from. Set access_control_allow_origin on the response to indicate which origins are allowed. 
  
parameter_storage_class  
alias of werkzeug.datastructures.ImmutableMultiDict 
  
path  
The path part of the URL after root_path. This is the path used for routing within the application. 
  
property pragma: werkzeug.datastructures.HeaderSet  
The Pragma general-header field is used to include implementation-specific directives that might apply to any recipient along the request/response chain. All pragma directives specify optional behavior from the viewpoint of the protocol; however, some systems MAY require that behavior be consistent with the directives. 
  
query_string  
The part of the URL after the “?”. This is the raw value, use args for the parsed values. 
  
property range: Optional[werkzeug.datastructures.Range]  
The parsed Range header.  Changelog New in version 0.7.   Return type 
Range   
  
referrer  
The Referer[sic] request-header field allows the client to specify, for the server’s benefit, the address (URI) of the resource from which the Request-URI was obtained (the “referrer”, although the header field is misspelled). 
  
remote_addr  
The address of the client sending the request. 
  
remote_user  
If the server supports user authentication, and the script is protected, this attribute contains the username the user has authenticated as. 
  
root_path  
The prefix that the application is mounted under, without a trailing slash. path comes after this. 
  
property root_url: str  
The request URL scheme, host, and root path. This is the root that the application is accessed from. 
  
scheme  
The URL scheme of the protocol the request used, such as https or wss. 
  
property script_root: str  
Alias for self.root_path. environ["SCRIPT_ROOT"] without a trailing slash. 
  
server  
The address of the server. (host, port), (path, None) for unix sockets, or None if not known. 
  
shallow: bool  
Set when creating the request object. If True, reading from the request body will cause a RuntimeException. Useful to prevent modifying the stream from middleware. 
  
property stream: BinaryIO  
If the incoming form data was not encoded with a known mimetype the data is stored unmodified in this stream for consumption. Most of the time it is a better idea to use data which will give you that data as a string. The stream only returns the data once. Unlike input_stream this stream is properly guarded that you can’t accidentally read past the length of the input. Werkzeug will internally always refer to this stream to read data which makes it possible to wrap this object with a stream that does filtering.  Changelog Changed in version 0.9: This stream is now always available but might be consumed by the form parser later on. Previously the stream was only set if no parsing happened.  

  
property url: str  
The full request URL with the scheme, host, root path, path, and query string. 
  
property url_charset: str  
The charset that is assumed for URLs. Defaults to the value of charset.  Changelog New in version 0.6.  

  
property url_root: str  
Alias for root_url. The URL with scheme, host, and root path. For example, https://example.com/app/. 
  
property user_agent: werkzeug.user_agent.UserAgent  
The user agent. Use user_agent.string to get the header value. Set user_agent_class to a subclass of UserAgent to provide parsing for the other properties or other extended data.  Changed in version 2.0: The built in parser is deprecated and will be removed in Werkzeug 2.1. A UserAgent subclass must be set to parse data from the string.  
  
user_agent_class  
alias of werkzeug.useragents._UserAgent 
  
property values: CombinedMultiDict[str, str]  
A werkzeug.datastructures.CombinedMultiDict that combines args and form. For GET requests, only args are present, not form.  Changed in version 2.0: For GET requests, only args are present, not form.  
  
property want_form_data_parsed: bool  
True if the request method carries content. By default this is true if a Content-Type is sent.  Changelog New in version 0.8.