summaryrefslogtreecommitdiff
path: root/docs/narr/webob.rst
diff options
context:
space:
mode:
authorJohn Anderson <sontek@gmail.com>2015-01-01 22:02:17 -0800
committerJohn Anderson <sontek@gmail.com>2015-01-01 22:02:17 -0800
commit538fd5cc68a59dbaa577aa4c6ff89cc7c7fa421f (patch)
tree5fe59ae987c429d8dea0babbde26ee91f41ff34f /docs/narr/webob.rst
parent582c2ed180120d07c825e4897350f5d1a6285afa (diff)
parent731a8e8380bbf9b41298c0417795e68899b91953 (diff)
downloadpyramid-538fd5cc68a59dbaa577aa4c6ff89cc7c7fa421f.tar.gz
pyramid-538fd5cc68a59dbaa577aa4c6ff89cc7c7fa421f.tar.bz2
pyramid-538fd5cc68a59dbaa577aa4c6ff89cc7c7fa421f.zip
Merge branch 'master' of https://github.com/sontek/pyramid into support_more_features_in_routes
Diffstat (limited to 'docs/narr/webob.rst')
-rw-r--r--docs/narr/webob.rst8
1 files changed, 8 insertions, 0 deletions
diff --git a/docs/narr/webob.rst b/docs/narr/webob.rst
index 6a331e4bf..0eb070b06 100644
--- a/docs/narr/webob.rst
+++ b/docs/narr/webob.rst
@@ -310,6 +310,14 @@ Python's ``urllib2`` instead of a Javascript AJAX request:
req = urllib2.Request('http://localhost:6543/', json_payload, headers)
resp = urllib2.urlopen(req)
+If you are doing Cross-origin resource sharing (CORS), then the standard
+requires the browser to do a pre-flight HTTP OPTIONS request. The easiest way
+to handling this is adding an extra ``view_config`` for the same route, with
+``request_method`` set to ``OPTIONS``, and setting the desired response header
+before returning. You can find examples of response headers here_.
+
+.. _here: https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS#Preflighted_requests
+
.. index::
single: cleaning up after request