summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorChris McDonough <chrism@plope.com>2011-07-04 03:58:00 -0400
committerChris McDonough <chrism@plope.com>2011-07-04 03:58:00 -0400
commitb78effb723e5a6b2f3980dac7830f8932abd7890 (patch)
treedd4bcabdab8db65e8b19fc21b4e9ac655c9a4cef /docs
parent0fa1993d2abe87e197374f6abd3e45e62afb8a19 (diff)
downloadpyramid-b78effb723e5a6b2f3980dac7830f8932abd7890.tar.gz
pyramid-b78effb723e5a6b2f3980dac7830f8932abd7890.tar.bz2
pyramid-b78effb723e5a6b2f3980dac7830f8932abd7890.zip
- New request attribute: ``json``. If the request's ``content_type`` is
``application/json``, this attribute will contain the JSON-decoded variant of the request body. If the request's ``content_type`` is not ``application/json``, this attribute will be ``None``.
Diffstat (limited to 'docs')
-rw-r--r--docs/api/request.rst7
-rw-r--r--docs/whatsnew-1.1.rst5
2 files changed, 12 insertions, 0 deletions
diff --git a/docs/api/request.rst b/docs/api/request.rst
index 27ce395ac..5dfb2ae9a 100644
--- a/docs/api/request.rst
+++ b/docs/api/request.rst
@@ -180,6 +180,13 @@
object (exposed to view code as ``request.response``) to influence
rendered response behavior.
+ .. attribute:: json
+
+ If the request's ``content_type`` is ``application/json``, this
+ attribute will contain the JSON-decoded variant of the request body.
+ If the request's ``content_type`` is not ``application/json``, this
+ attribute will be ``None``.
+
.. note::
For information about the API of a :term:`multidict` structure (such as
diff --git a/docs/whatsnew-1.1.rst b/docs/whatsnew-1.1.rst
index 783f2caaa..fdf3b1c74 100644
--- a/docs/whatsnew-1.1.rst
+++ b/docs/whatsnew-1.1.rst
@@ -94,6 +94,11 @@ Default HTTP Exception View
Minor Feature Additions
-----------------------
+- New request attribute: ``json``. If the request's ``content_type`` is
+ ``application/json``, this attribute will contain the JSON-decoded
+ variant of the request body. If the request's ``content_type`` is not
+ ``application/json``, this attribute will be ``None``.
+
- A new value ``http_cache`` can be used as a :term:`view configuration`
parameter.