forked from orbit-oss/flask
parent
71c534d2c6
commit
49386ee69e
1 changed files with 1 additions and 57 deletions
58
docs/api.rst
58
docs/api.rst
|
|
@ -30,61 +30,12 @@ Incoming Request Data
|
||||||
|
|
||||||
.. autoclass:: Request
|
.. autoclass:: Request
|
||||||
:members:
|
:members:
|
||||||
|
:inherited-members:
|
||||||
.. attribute:: form
|
|
||||||
|
|
||||||
A :class:`~werkzeug.datastructures.MultiDict` with the parsed form data from ``POST``
|
|
||||||
or ``PUT`` requests. Please keep in mind that file uploads will not
|
|
||||||
end up here, but instead in the :attr:`files` attribute.
|
|
||||||
|
|
||||||
.. attribute:: args
|
|
||||||
|
|
||||||
A :class:`~werkzeug.datastructures.MultiDict` with the parsed contents of the query
|
|
||||||
string. (The part in the URL after the question mark).
|
|
||||||
|
|
||||||
.. attribute:: values
|
|
||||||
|
|
||||||
A :class:`~werkzeug.datastructures.CombinedMultiDict` with the contents of both
|
|
||||||
:attr:`form` and :attr:`args`.
|
|
||||||
|
|
||||||
.. attribute:: cookies
|
|
||||||
|
|
||||||
A :class:`dict` with the contents of all cookies transmitted with
|
|
||||||
the request.
|
|
||||||
|
|
||||||
.. attribute:: stream
|
|
||||||
|
|
||||||
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 :attr:`data` which will give
|
|
||||||
you that data as a string. The stream only returns the data once.
|
|
||||||
|
|
||||||
.. attribute:: headers
|
|
||||||
|
|
||||||
The incoming request headers as a dictionary like object.
|
|
||||||
|
|
||||||
.. attribute:: data
|
|
||||||
|
|
||||||
Contains the incoming request data as string in case it came with
|
|
||||||
a mimetype Flask does not handle.
|
|
||||||
|
|
||||||
.. attribute:: files
|
|
||||||
|
|
||||||
A :class:`~werkzeug.datastructures.MultiDict` with files uploaded as part of a
|
|
||||||
``POST`` or ``PUT`` request. Each file is stored as
|
|
||||||
:class:`~werkzeug.datastructures.FileStorage` object. It basically behaves like a
|
|
||||||
standard file object you know from Python, with the difference that
|
|
||||||
it also has a :meth:`~werkzeug.datastructures.FileStorage.save` function that can
|
|
||||||
store the file on the filesystem.
|
|
||||||
|
|
||||||
.. attribute:: environ
|
.. attribute:: environ
|
||||||
|
|
||||||
The underlying WSGI environment.
|
The underlying WSGI environment.
|
||||||
|
|
||||||
.. attribute:: method
|
|
||||||
|
|
||||||
The current request method (``POST``, ``GET`` etc.)
|
|
||||||
|
|
||||||
.. attribute:: path
|
.. attribute:: path
|
||||||
.. attribute:: full_path
|
.. attribute:: full_path
|
||||||
.. attribute:: script_root
|
.. attribute:: script_root
|
||||||
|
|
@ -114,13 +65,6 @@ Incoming Request Data
|
||||||
`url_root` ``u'http://www.example.com/myapplication/'``
|
`url_root` ``u'http://www.example.com/myapplication/'``
|
||||||
============= ======================================================
|
============= ======================================================
|
||||||
|
|
||||||
.. attribute:: is_xhr
|
|
||||||
|
|
||||||
``True`` if the request was triggered via a JavaScript
|
|
||||||
`XMLHttpRequest`. This only works with libraries that support the
|
|
||||||
``X-Requested-With`` header and set it to `XMLHttpRequest`.
|
|
||||||
Libraries that do that are prototype, jQuery and Mochikit and
|
|
||||||
probably some more.
|
|
||||||
|
|
||||||
.. class:: request
|
.. class:: request
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue