doc_content stringlengths 1 386k | doc_id stringlengths 5 188 |
|---|---|
class werkzeug.routing.MapAdapter(map, server_name, script_name, subdomain, url_scheme, path_info, default_method, query_args=None)
Returned by Map.bind() or Map.bind_to_environ() and does the URL matching and building based on runtime information. Parameters
map (werkzeug.routing.Map) β
server_name (str) β
s... | werkzeug.routing.index#werkzeug.routing.MapAdapter |
allowed_methods(path_info=None)
Returns the valid methods that match for a given path. Changelog New in version 0.7. Parameters
path_info (Optional[str]) β Return type
Iterable[str] | werkzeug.routing.index#werkzeug.routing.MapAdapter.allowed_methods |
build(endpoint, values=None, method=None, force_external=False, append_unknown=True, url_scheme=None)
Building URLs works pretty much the other way round. Instead of match you call build and pass it the endpoint and a dict of arguments for the placeholders. The build function also accepts an argument called force_ext... | werkzeug.routing.index#werkzeug.routing.MapAdapter.build |
dispatch(view_func, path_info=None, method=None, catch_http_exceptions=False)
Does the complete dispatching process. view_func is called with the endpoint and a dict with the values for the view. It should look up the view function, call it, and return a response object or WSGI application. http exceptions are not ca... | werkzeug.routing.index#werkzeug.routing.MapAdapter.dispatch |
get_host(domain_part)
Figures out the full host name for the given domain part. The domain part is a subdomain in case host matching is disabled or a full host name. Parameters
domain_part (Optional[str]) β Return type
str | werkzeug.routing.index#werkzeug.routing.MapAdapter.get_host |
make_alias_redirect_url(path, endpoint, values, method, query_args)
Internally called to make an alias redirect URL. Parameters
path (str) β
endpoint (str) β
values (Mapping[str, Any]) β
method (str) β
query_args (Union[Mapping[str, Any], str]) β Return type
str | werkzeug.routing.index#werkzeug.routing.MapAdapter.make_alias_redirect_url |
match(path_info=None, method=None, return_rule=False, query_args=None, websocket=None)
The usage is simple: you just pass the match method the current path info as well as the method (which defaults to GET). The following things can then happen: you receive a NotFound exception that indicates that no URL is matching... | werkzeug.routing.index#werkzeug.routing.MapAdapter.match |
test(path_info=None, method=None)
Test if a rule would match. Works like match but returns True if the URL matches, or False if it does not exist. Parameters
path_info (Optional[str]) β the path info to use for matching. Overrides the path info specified on binding.
method (Optional[str]) β the HTTP method used ... | werkzeug.routing.index#werkzeug.routing.MapAdapter.test |
Middleware A WSGI middleware is a WSGI application that wraps another application in order to observe or change its behavior. Werkzeug provides some middleware for common use cases. X-Forwarded-For Proxy Fix Serve Shared Static Files Application Dispatcher Basic HTTP Proxy WSGI Protocol Linter Application Profiler Th... | werkzeug.middleware.index |
class werkzeug.datastructures.MIMEAccept(values=())
Like Accept but with special methods and behavior for mimetypes.
property accept_html
True if this object accepts HTML.
property accept_json
True if this object accepts JSON.
property accept_xhtml
True if this object accepts XHTML. | werkzeug.datastructures.index#werkzeug.datastructures.MIMEAccept |
class werkzeug.datastructures.MultiDict(mapping=None)
A MultiDict is a dictionary subclass customized to deal with multiple values for the same key which is for example used by the parsing functions in the wrappers. This is necessary because some HTML form elements pass multiple values for the same key. MultiDict imp... | werkzeug.datastructures.index#werkzeug.datastructures.MultiDict |
add(key, value)
Adds a new value for the key. Changelog New in version 0.6. Parameters
key β the key for the value.
value β the value to add. | werkzeug.datastructures.index#werkzeug.datastructures.MultiDict.add |
clear() β None. Remove all items from D. | werkzeug.datastructures.index#werkzeug.datastructures.MultiDict.clear |
copy()
Return a shallow copy of this object. | werkzeug.datastructures.index#werkzeug.datastructures.MultiDict.copy |
deepcopy(memo=None)
Return a deep copy of this object. | werkzeug.datastructures.index#werkzeug.datastructures.MultiDict.deepcopy |
fromkeys(value=None, /)
Create a new dictionary with keys from iterable and values set to value. | werkzeug.datastructures.index#werkzeug.datastructures.MultiDict.fromkeys |
get(key, default=None, type=None)
Return the default value if the requested data doesnβt exist. If type is provided and is a callable it should convert the value, return it or raise a ValueError if that is not possible. In this case the function will return the default as if the value was not found: >>> d = TypeConve... | werkzeug.datastructures.index#werkzeug.datastructures.MultiDict.get |
getlist(key, type=None)
Return the list of items for a given key. If that key is not in the MultiDict, the return value will be an empty list. Just like get, getlist accepts a type parameter. All items will be converted with the callable defined there. Parameters
key β The key to be looked up.
type β A callable ... | werkzeug.datastructures.index#werkzeug.datastructures.MultiDict.getlist |
items(multi=False)
Return an iterator of (key, value) pairs. Parameters
multi β If set to True the iterator returned will have a pair for each value of each key. Otherwise it will only contain pairs for the first value of each key. | werkzeug.datastructures.index#werkzeug.datastructures.MultiDict.items |
keys() β a set-like object providing a view on Dβs keys | werkzeug.datastructures.index#werkzeug.datastructures.MultiDict.keys |
lists()
Return a iterator of (key, values) pairs, where values is the list of all values associated with the key. | werkzeug.datastructures.index#werkzeug.datastructures.MultiDict.lists |
listvalues()
Return an iterator of all values associated with a key. Zipping keys() and this is the same as calling lists(): >>> d = MultiDict({"foo": [1, 2, 3]})
>>> zip(d.keys(), d.listvalues()) == d.lists()
True | werkzeug.datastructures.index#werkzeug.datastructures.MultiDict.listvalues |
pop(key, default=no value)
Pop the first item for a list on the dict. Afterwards the key is removed from the dict, so additional values are discarded: >>> d = MultiDict({"foo": [1, 2, 3]})
>>> d.pop("foo")
1
>>> "foo" in d
False
Parameters
key β the key to pop.
default β if provided the value to return if the k... | werkzeug.datastructures.index#werkzeug.datastructures.MultiDict.pop |
popitem()
Pop an item from the dict. | werkzeug.datastructures.index#werkzeug.datastructures.MultiDict.popitem |
popitemlist()
Pop a (key, list) tuple from the dict. | werkzeug.datastructures.index#werkzeug.datastructures.MultiDict.popitemlist |
poplist(key)
Pop the list for a key from the dict. If the key is not in the dict an empty list is returned. Changelog Changed in version 0.5: If the key does no longer exist a list is returned instead of raising an error. | werkzeug.datastructures.index#werkzeug.datastructures.MultiDict.poplist |
setdefault(key, default=None)
Returns the value for the key if it is in the dict, otherwise it returns default and sets that value for key. Parameters
key β The key to be looked up.
default β The default value to be returned if the key is not in the dict. If not further specified itβs None. | werkzeug.datastructures.index#werkzeug.datastructures.MultiDict.setdefault |
setlist(key, new_list)
Remove the old values for a key and add new ones. Note that the list you pass the values in will be shallow-copied before it is inserted in the dictionary. >>> d = MultiDict()
>>> d.setlist('foo', ['1', '2'])
>>> d['foo']
'1'
>>> d.getlist('foo')
['1', '2']
Parameters
key β The key for whi... | werkzeug.datastructures.index#werkzeug.datastructures.MultiDict.setlist |
setlistdefault(key, default_list=None)
Like setdefault but sets multiple values. The list returned is not a copy, but the list that is actually used internally. This means that you can put new values into the dict by appending items to the list: >>> d = MultiDict({"foo": 1})
>>> d.setlistdefault("foo").extend([2, 3])... | werkzeug.datastructures.index#werkzeug.datastructures.MultiDict.setlistdefault |
to_dict(flat=True)
Return the contents as regular dict. If flat is True the returned dict will only have the first item present, if flat is False all values will be returned as lists. Parameters
flat β If set to False the dict returned will have lists with all the values in it. Otherwise it will only contain the fi... | werkzeug.datastructures.index#werkzeug.datastructures.MultiDict.to_dict |
update(mapping)
update() extends rather than replaces existing key lists: >>> a = MultiDict({'x': 1})
>>> b = MultiDict({'x': 2, 'y': 3})
>>> a.update(b)
>>> a
MultiDict([('y', 3), ('x', 1), ('x', 2)])
If the value list for a key in other_dict is empty, no new values will be added to the dict and the key will not be... | werkzeug.datastructures.index#werkzeug.datastructures.MultiDict.update |
values()
Returns an iterator of the first value on every keyβs value list. | werkzeug.datastructures.index#werkzeug.datastructures.MultiDict.values |
class werkzeug.datastructures.OrderedMultiDict(mapping=None)
Works like a regular MultiDict but preserves the order of the fields. To convert the ordered multi dict into a list you can use the items() method and pass it multi=True. In general an OrderedMultiDict is an order of magnitude slower than a MultiDict. note... | werkzeug.datastructures.index#werkzeug.datastructures.OrderedMultiDict |
werkzeug.http.parse_accept_header(value[, class])
Parses an HTTP Accept-* header. This does not implement a complete valid algorithm but one that supports at least value and quality extraction. Returns a new Accept object (basically a list of (value, quality) tuples sorted by the quality with some additional accessor... | werkzeug.http.index#werkzeug.http.parse_accept_header |
werkzeug.http.parse_authorization_header(value)
Parse an HTTP basic/digest authorization header transmitted by the web browser. The return value is either None if the header was invalid or not given, otherwise an Authorization object. Parameters
value (Optional[str]) β the authorization header to parse. Returns
a... | werkzeug.http.index#werkzeug.http.parse_authorization_header |
werkzeug.http.parse_cache_control_header(value, on_update=None, cls=None)
Parse a cache control header. The RFC differs between response and request cache control, this method does not. Itβs your responsibility to not use the wrong control statements. Changelog New in version 0.5: The cls was added. If not specified... | werkzeug.http.index#werkzeug.http.parse_cache_control_header |
werkzeug.http.parse_content_range_header(value, on_update=None)
Parses a range header into a ContentRange object or None if parsing is not possible. Changelog New in version 0.7. Parameters
value (Optional[str]) β a content range header to be parsed.
on_update (Optional[Callable[[werkzeug.datastructures.Conten... | werkzeug.http.index#werkzeug.http.parse_content_range_header |
werkzeug.http.parse_cookie(header, charset='utf-8', errors='replace', cls=None)
Parse a cookie from a string or WSGI environ. The same key can be provided multiple times, the values are stored in-order. The default MultiDict will have the first value first, and all values can be retrieved with MultiDict.getlist(). P... | werkzeug.http.index#werkzeug.http.parse_cookie |
werkzeug.http.parse_date(value)
Parse an RFC 2822 date into a timezone-aware datetime.datetime object, or None if parsing fails. This is a wrapper for email.utils.parsedate_to_datetime(). It returns None if parsing fails instead of raising an exception, and always returns a timezone-aware datetime object. If the stri... | werkzeug.http.index#werkzeug.http.parse_date |
werkzeug.http.parse_dict_header(value, cls=<class 'dict'>)
Parse lists of key, value pairs as described by RFC 2068 Section 2 and convert them into a python dict (or any other mapping object created from the type with a dict like interface provided by the cls argument): >>> d = parse_dict_header('foo="is a fish", bar... | werkzeug.http.index#werkzeug.http.parse_dict_header |
werkzeug.http.parse_etags(value)
Parse an etag header. Parameters
value (Optional[str]) β the tag header to parse Returns
an ETags object. Return type
werkzeug.datastructures.ETags | werkzeug.http.index#werkzeug.http.parse_etags |
werkzeug.formparser.parse_form_data(environ, stream_factory=None, charset='utf-8', errors='replace', max_form_memory_size=None, max_content_length=None, cls=None, silent=True)
Parse the form data in the environ and return it as tuple in the form (stream, form, files). You should only call this method if the transport... | werkzeug.http.index#werkzeug.formparser.parse_form_data |
werkzeug.http.parse_if_range_header(value)
Parses an if-range header which can be an etag or a date. Returns a IfRange object. Changed in version 2.0: If the value represents a datetime, it is timezone-aware. Changelog New in version 0.7. Parameters
value (Optional[str]) β Return type
werkzeug.datastructures... | werkzeug.http.index#werkzeug.http.parse_if_range_header |
werkzeug.http.parse_list_header(value)
Parse lists as described by RFC 2068 Section 2. In particular, parse comma-separated lists where the elements of the list may include quoted-strings. A quoted-string could contain a comma. A non-quoted string could have quotes in the middle. Quotes are removed automatically afte... | werkzeug.http.index#werkzeug.http.parse_list_header |
werkzeug.http.parse_options_header(value, multiple=False)
Parse a Content-Type like header into a tuple with the content type and the options: >>> parse_options_header('text/html; charset=utf8')
('text/html', {'charset': 'utf8'})
This should not be used to parse Cache-Control like headers that use a slightly differe... | werkzeug.http.index#werkzeug.http.parse_options_header |
werkzeug.http.parse_range_header(value, make_inclusive=True)
Parses a range header into a Range object. If the header is missing or malformed None is returned. ranges is a list of (start, stop) tuples where the ranges are non-inclusive. Changelog New in version 0.7. Parameters
value (Optional[str]) β
make_inc... | werkzeug.http.index#werkzeug.http.parse_range_header |
werkzeug.http.parse_set_header(value, on_update=None)
Parse a set-like header and return a HeaderSet object: >>> hs = parse_set_header('token, "quoted value"')
The return value is an object that treats the items case-insensitively and keeps the order of the items: >>> 'TOKEN' in hs
True
>>> hs.index('quoted value')
... | werkzeug.http.index#werkzeug.http.parse_set_header |
werkzeug.http.parse_www_authenticate_header(value, on_update=None)
Parse an HTTP WWW-Authenticate header into a WWWAuthenticate object. Parameters
value (Optional[str]) β a WWW-Authenticate header to parse.
on_update (Optional[Callable[[werkzeug.datastructures.WWWAuthenticate], None]]) β an optional callable tha... | werkzeug.http.index#werkzeug.http.parse_www_authenticate_header |
class werkzeug.routing.PathConverter(map, *args, **kwargs)
Like the default UnicodeConverter, but it also matches slashes. This is useful for wikis and similar applications: Rule('/<path:wikipage>')
Rule('/<path:wikipage>/edit')
Parameters
map (Map) β the Map.
args (Any) β
kwargs (Any) β Return type
None | werkzeug.routing.index#werkzeug.routing.PathConverter |
werkzeug.security.pbkdf2_bin(data, salt, iterations=260000, keylen=None, hashfunc=None)
Returns a binary digest for the PBKDF2 hash algorithm of data with the given salt. It iterates iterations times and produces a key of keylen bytes. By default, SHA-256 is used as hash function; a different hashlib hashfunc can be ... | werkzeug.utils.index#werkzeug.security.pbkdf2_bin |
werkzeug.security.pbkdf2_hex(data, salt, iterations=260000, keylen=None, hashfunc=None)
Like pbkdf2_bin(), but returns a hex-encoded string. Parameters
data (Union[str, bytes]) β the data to derive.
salt (Union[str, bytes]) β the salt for the derivation.
iterations (int) β the number of iterations.
keylen (Opt... | werkzeug.utils.index#werkzeug.security.pbkdf2_hex |
werkzeug.wsgi.peek_path_info(environ, charset='utf-8', errors='replace')
Returns the next segment on the PATH_INFO or None if there is none. Works like pop_path_info() without modifying the environment: >>> env = {'SCRIPT_NAME': '/foo', 'PATH_INFO': '/a/b'}
>>> peek_path_info(env)
'a'
>>> peek_path_info(env)
'a'
If ... | werkzeug.wsgi.index#werkzeug.wsgi.peek_path_info |
werkzeug.wsgi.pop_path_info(environ, charset='utf-8', errors='replace')
Removes and returns the next segment of PATH_INFO, pushing it onto SCRIPT_NAME. Returns None if there is nothing left on PATH_INFO. If the charset is set to None bytes are returned. If there are empty segments ('/foo//bar) these are ignored but p... | werkzeug.wsgi.index#werkzeug.wsgi.pop_path_info |
class werkzeug.middleware.profiler.ProfilerMiddleware(app, stream=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>, sort_by=('time', 'calls'), restrictions=(), profile_dir=None, filename_format='{method}.{path}.{elapsed:.0f}ms.{time:.0f}.prof')
Wrap a WSGI application and profile the execution of each re... | werkzeug.middleware.profiler.index#werkzeug.middleware.profiler.ProfilerMiddleware |
class werkzeug.middleware.proxy_fix.ProxyFix(app, x_for=1, x_proto=1, x_host=0, x_port=0, x_prefix=0)
Adjust the WSGI environ based on X-Forwarded- that proxies in front of the application may set.
X-Forwarded-For sets REMOTE_ADDR.
X-Forwarded-Proto sets wsgi.url_scheme.
X-Forwarded-Host sets HTTP_HOST, SERVER_NA... | werkzeug.middleware.proxy_fix.index#werkzeug.middleware.proxy_fix.ProxyFix |
class werkzeug.middleware.http_proxy.ProxyMiddleware(app, targets, chunk_size=16384, timeout=10)
Proxy requests under a path to an external server, routing other requests to the app. This middleware can only proxy HTTP requests, as HTTP is the only protocol handled by the WSGI server. Other protocols, such as WebSock... | werkzeug.middleware.http_proxy.index#werkzeug.middleware.http_proxy.ProxyMiddleware |
Quickstart This part of the documentation shows how to use the most important parts of Werkzeug. Itβs intended as a starting point for developers with basic understanding of PEP 3333 (WSGI) and RFC 2616 (HTTP). | werkzeug.quickstart.index |
werkzeug.http.quote_etag(etag, weak=False)
Quote an etag. Parameters
etag (str) β the etag to quote.
weak (bool) β set to True to tag it βweakβ. Return type
str | werkzeug.http.index#werkzeug.http.quote_etag |
werkzeug.http.quote_header_value(value, extra_chars='', allow_token=True)
Quote a header value if necessary. Changelog New in version 0.5. Parameters
value (Union[str, int]) β the value to quote.
extra_chars (str) β a list of extra characters to skip quoting.
allow_token (bool) β if this is enabled token valu... | werkzeug.http.index#werkzeug.http.quote_header_value |
class werkzeug.datastructures.Range(units, ranges)
Represents a Range header. All methods only support only bytes as the unit. Stores a list of ranges if given, but the methods only work if only one range is provided. Raises
ValueError β If the ranges provided are invalid. Changelog Changed in version 0.15: The ... | werkzeug.datastructures.index#werkzeug.datastructures.Range |
make_content_range(length)
Creates a ContentRange object from the current range and given content length. | werkzeug.datastructures.index#werkzeug.datastructures.Range.make_content_range |
ranges
A list of (begin, end) tuples for the range header provided. The ranges are non-inclusive. | werkzeug.datastructures.index#werkzeug.datastructures.Range.ranges |
range_for_length(length)
If the range is for bytes, the length is not None and there is exactly one range and it is satisfiable it returns a (start, stop) tuple, otherwise None. | werkzeug.datastructures.index#werkzeug.datastructures.Range.range_for_length |
to_content_range_header(length)
Converts the object into Content-Range HTTP header, based on given length | werkzeug.datastructures.index#werkzeug.datastructures.Range.to_content_range_header |
to_header()
Converts the object back into an HTTP header. | werkzeug.datastructures.index#werkzeug.datastructures.Range.to_header |
units
The units of this range. Usually βbytesβ. | werkzeug.datastructures.index#werkzeug.datastructures.Range.units |
werkzeug.utils.redirect(location, code=302, Response=None)
Returns a response object (a WSGI application) that, if called, redirects the client to the target location. Supported codes are 301, 302, 303, 305, 307, and 308. 300 is not supported because itβs not a real redirect and 304 because itβs the answer for a requ... | werkzeug.utils.index#werkzeug.utils.redirect |
werkzeug.local.release_local(local)
Releases the contents of the local for the current context. This makes it possible to use locals without a manager. Example: >>> loc = Local()
>>> loc.foo = 42
>>> release_local(loc)
>>> hasattr(loc, 'foo')
False
With this function one can release Local objects as well as LocalSta... | werkzeug.local.index#werkzeug.local.release_local |
werkzeug.http.remove_entity_headers(headers, allowed=('expires', 'content-location'))
Remove all entity headers from a list or Headers object. This operation works in-place. Expires and Content-Location headers are by default not removed. The reason for this is RFC 2616 section 10.3.5 which specifies some entity head... | werkzeug.http.index#werkzeug.http.remove_entity_headers |
werkzeug.http.remove_hop_by_hop_headers(headers)
Remove all HTTP/1.1 βHop-by-Hopβ headers from a list or Headers object. This operation works in-place. Changelog New in version 0.5. Parameters
headers (Union[werkzeug.datastructures.Headers, List[Tuple[str, str]]]) β a list or Headers object. Return type
None | werkzeug.http.index#werkzeug.http.remove_hop_by_hop_headers |
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 a... | werkzeug.wrappers.index#werkzeug.wrappers.Request |
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. | werkzeug.wrappers.index#werkzeug.wrappers.Request.access_control_request_headers |
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. | werkzeug.wrappers.index#werkzeug.wrappers.Request.access_control_request_method |
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):
... | werkzeug.wrappers.index#werkzeug.wrappers.Request.application |
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 | werkzeug.wrappers.index#werkzeug.wrappers.Request.close |
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 ... | werkzeug.wrappers.index#werkzeug.wrappers.Request.content_encoding |
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 m... | werkzeug.wrappers.index#werkzeug.wrappers.Request.content_md5 |
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. | werkzeug.wrappers.index#werkzeug.wrappers.Request.content_type |
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. | werkzeug.wrappers.index#werkzeug.wrappers.Request.date |
dict_storage_class
alias of werkzeug.datastructures.ImmutableMultiDict | werkzeug.wrappers.index#werkzeug.wrappers.Request.dict_storage_class |
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. | werkzeug.wrappers.index#werkzeug.wrappers.Request.disable_data_descriptor |
environ: WSGIEnvironment
The WSGI environment containing HTTP headers and information from the WSGI server. | werkzeug.wrappers.index#werkzeug.wrappers.Request.environ |
form_data_parser_class
alias of werkzeug.formparser.FormDataParser | werkzeug.wrappers.index#werkzeug.wrappers.Request.form_data_parser_class |
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 ... | werkzeug.wrappers.index#werkzeug.wrappers.Request.from_values |
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 clien... | werkzeug.wrappers.index#werkzeug.wrappers.Request.get_data |
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 ... | werkzeug.wrappers.index#werkzeug.wrappers.Request.get_json |
headers
The headers received with the request. | werkzeug.wrappers.index#werkzeug.wrappers.Request.headers |
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. | werkzeug.wrappers.index#werkzeug.wrappers.Request.input_stream |
is_multiprocess
boolean that is True if the application is served by a WSGI server that spawns multiple processes. | werkzeug.wrappers.index#werkzeug.wrappers.Request.is_multiprocess |
is_multithread
boolean that is True if the application is served by a multithreaded WSGI server. | werkzeug.wrappers.index#werkzeug.wrappers.Request.is_multithread |
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. | werkzeug.wrappers.index#werkzeug.wrappers.Request.is_run_once |
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. | werkzeug.wrappers.index#werkzeug.wrappers.Request.json_module |
list_storage_class
alias of werkzeug.datastructures.ImmutableList | werkzeug.wrappers.index#werkzeug.wrappers.Request.list_storage_class |
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 | werkzeug.wrappers.index#werkzeug.wrappers.Request.make_form_data_parser |
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. Hav... | werkzeug.wrappers.index#werkzeug.wrappers.Request.max_content_length |
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. Hav... | werkzeug.wrappers.index#werkzeug.wrappers.Request.max_form_memory_size |
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. | werkzeug.wrappers.index#werkzeug.wrappers.Request.max_forwards |
method
The method the request was made with, such as GET. | werkzeug.wrappers.index#werkzeug.wrappers.Request.method |
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 | werkzeug.wrappers.index#werkzeug.wrappers.Request.on_json_loading_failed |
origin
The host that the request originated from. Set access_control_allow_origin on the response to indicate which origins are allowed. | werkzeug.wrappers.index#werkzeug.wrappers.Request.origin |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.