diff options
| author | Chris McDonough <chrism@plope.com> | 2015-04-02 13:57:30 -0400 |
|---|---|---|
| committer | Chris McDonough <chrism@plope.com> | 2015-04-02 13:57:30 -0400 |
| commit | 45ddb5a5b744aebeac6004e9dba1c03d5bc8c50f (patch) | |
| tree | 9efe59281dbc0b20b9a94b69ee0a18bcb124aa93 /docs/narr/webob.rst | |
| parent | b6498fce8c1418f3c7b33d31aa9c151a86bc4166 (diff) | |
| parent | 575ff8050b0cbdbf424947361f419b803568e122 (diff) | |
| download | pyramid-45ddb5a5b744aebeac6004e9dba1c03d5bc8c50f.tar.gz pyramid-45ddb5a5b744aebeac6004e9dba1c03d5bc8c50f.tar.bz2 pyramid-45ddb5a5b744aebeac6004e9dba1c03d5bc8c50f.zip | |
Merge branch 'master' of github.com:Pylons/pyramid
Diffstat (limited to 'docs/narr/webob.rst')
| -rw-r--r-- | docs/narr/webob.rst | 8 |
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 |
