class flask.Request(environ, populate_request=True, shallow=False)  
The request object used by default in Flask. Remembers the matched endpoint and view arguments. It is what ends up as request. If you want to replace the request object used you can subclass this and set request_class to your subclass. The request object is a Request subclass and provides all of the attributes Werkzeug defines plus a few Flask specific ones.  Parameters 
 
environ (WSGIEnvironment) –  
populate_request (bool) –  
shallow (bool) –    Return type 
None    
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 blueprint: Optional[str]  
The name of the current blueprint 
  
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 
  
property endpoint: Optional[str]  
The endpoint that matched the request. This in combination with view_args can be used to reconstruct the same or a modified URL. If an exception happened when matching, this will be None. 
  
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. 
  
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   
  
property max_content_length: Optional[int]  
Read-only view of the MAX_CONTENT_LENGTH config key. 
  
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 (Exception) –   Return type 
NoReturn   
  
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. 
  
routing_exception: Optional[Exception] = None  
If matching the URL failed, this is the exception that will be raised / was raised as part of the request handling. This is usually a NotFound exception or something similar. 
  
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/. 
  
url_rule: Optional[Rule] = None  
The internal URL rule that matched the request. This can be useful to inspect which methods are allowed for the URL from a before/after handler (request.url_rule.methods) etc. Though if the request’s method was invalid for the URL rule, the valid list is available in routing_exception.valid_methods instead (an attribute of the Werkzeug exception MethodNotAllowed) because the request was never internally bound.  Changelog New in version 0.6.  

  
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.  
  
view_args: Optional[Dict[str, Any]] = None  
A dict of view arguments that matched the request. If an exception happened when matching, this will be None. 
  
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.