summaryrefslogtreecommitdiff
path: root/docs/narr/webob.rst
diff options
context:
space:
mode:
authorMichael Merickel <michael@merickel.org>2015-02-11 12:32:26 -0600
committerMichael Merickel <michael@merickel.org>2015-02-11 12:32:35 -0600
commit6e9e2dbb364f371b034b681dd44e6e6b831c5760 (patch)
treeb7d8c623706f5df330d9c72d4e1c9d84dd47b6cd /docs/narr/webob.rst
parent14126cae5cf308ed466ed3eea576094e9c2193b4 (diff)
parent1dc1f28e1184960f5359c6c510d23a0e6e9dafe8 (diff)
downloadpyramid-6e9e2dbb364f371b034b681dd44e6e6b831c5760.tar.gz
pyramid-6e9e2dbb364f371b034b681dd44e6e6b831c5760.tar.bz2
pyramid-6e9e2dbb364f371b034b681dd44e6e6b831c5760.zip
Merge branch 'master' into feature.py3-coverage
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