summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Merickel <michael@merickel.org>2014-05-01 13:34:17 -0500
committerMichael Merickel <michael@merickel.org>2014-05-01 13:34:17 -0500
commit306c298d897acb5b751fa7dc0b8081b48007686f (patch)
tree2c1dfca6c28abc0082b1042988af4e087251bbec
parentdd4f73f2543e350c0b4141efe31842be00161fa9 (diff)
downloadpyramid-306c298d897acb5b751fa7dc0b8081b48007686f.tar.gz
pyramid-306c298d897acb5b751fa7dc0b8081b48007686f.tar.bz2
pyramid-306c298d897acb5b751fa7dc0b8081b48007686f.zip
fix #1253
-rw-r--r--docs/narr/viewconfig.rst13
-rw-r--r--pyramid/config/views.py10
2 files changed, 13 insertions, 10 deletions
diff --git a/docs/narr/viewconfig.rst b/docs/narr/viewconfig.rst
index adc53bd11..a0feef8d7 100644
--- a/docs/narr/viewconfig.rst
+++ b/docs/narr/viewconfig.rst
@@ -295,11 +295,14 @@ configured view.
*This is an advanced feature, not often used by "civilians"*.
``request_method``
- This value can be a string (typically ``"GET"``, ``"POST"``, ``"PUT"``,
- ``"DELETE"``, or ``"HEAD"``) representing an HTTP ``REQUEST_METHOD``. A view
- declaration with this argument ensures that the view will only be called
- when the request's ``method`` attribute (aka the ``REQUEST_METHOD`` of the
- WSGI environment) string matches the supplied value.
+ This value can be either a string (such as ``"GET"``, ``"POST"``,
+ ``"PUT"``, ``"DELETE"``, ``"HEAD"`` or ``"OPTIONS"``) representing an
+ HTTP ``REQUEST_METHOD``, or a tuple containing one or more of these
+ strings. A view declaration with this argument ensures that the
+ view will only be called when the ``method`` attribute of the
+ request (aka the ``REQUEST_METHOD`` of the WSGI environment) matches
+ a supplied value. Note that use of ``"GET"`` also implies that the
+ view will respond to ``"HEAD"`` as of Pyramid 1.4.
If ``request_method`` is not supplied, the view will be invoked regardless
of the ``REQUEST_METHOD`` of the :term:`WSGI` environment.
diff --git a/pyramid/config/views.py b/pyramid/config/views.py
index 2f6c758ab..7a6157ec8 100644
--- a/pyramid/config/views.py
+++ b/pyramid/config/views.py
@@ -879,11 +879,11 @@ class ViewsConfiguratorMixin(object):
request_method
- This value can be either a strings (such as ``GET``, ``POST``,
- ``PUT``, ``DELETE``, or ``HEAD``) representing an HTTP
- ``REQUEST_METHOD``, or a tuple containing one or more of these
- strings. A view declaration with this argument ensures that the
- view will only be called when the ``method`` attribute of the
+ This value can be either a string (such as ``"GET"``, ``"POST"``,
+ ``"PUT"``, ``"DELETE"``, ``"HEAD"`` or ``"OPTIONS"``) representing
+ an HTTP ``REQUEST_METHOD``, or a tuple containing one or more of
+ these strings. A view declaration with this argument ensures that
+ the view will only be called when the ``method`` attribute of the
request (aka the ``REQUEST_METHOD`` of the WSGI environment) matches
a supplied value. Note that use of ``GET`` also implies that the
view will respond to ``HEAD`` as of Pyramid 1.4.