aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorTom Christie2013-03-12 13:40:48 -0700
committerTom Christie2013-03-12 13:40:48 -0700
commit716d86863f022e7dd4b9b71ecde1d908f30bdf60 (patch)
treef211c53e772bdfebf979cf4a1c8162849feb01f8 /docs
parent043d748b539a6f5b4cfdf6de650b072541f1c6da (diff)
parent2bcb8ff12c967e71fb4871a9ac9e72395394d291 (diff)
downloaddjango-rest-framework-716d86863f022e7dd4b9b71ecde1d908f30bdf60.tar.bz2
Merge pull request #695 from kuhnza/master
Support for X-HTTP-Method-Override Header
Diffstat (limited to 'docs')
-rw-r--r--docs/topics/browser-enhancements.md18
1 files changed, 18 insertions, 0 deletions
diff --git a/docs/topics/browser-enhancements.md b/docs/topics/browser-enhancements.md
index 6a11f0fa..8b191423 100644
--- a/docs/topics/browser-enhancements.md
+++ b/docs/topics/browser-enhancements.md
@@ -19,6 +19,23 @@ For example, given the following form:
`request.method` would return `"DELETE"`.
+## HTTP header based method overriding
+
+REST framework also supports method overriding via the `X-HTTP-Method-Override`
+header. This is useful if you are working with non-form content such as
+JSON and are working with an older web server and/or hosting provider
+(e.g. [Amazon Web Services ELB][aws_elb]) that doesn't recognise particular
+HTTP methods such as `PATCH`.
+
+For example, making a `PATCH` request via `POST` in jQuery:
+
+ $.ajax({
+ url: '/myresource/',
+ method: 'POST',
+ headers: {'X-HTTP-Method-Override': 'PATCH'},
+ ...
+ });
+
## Browser based submission of non-form content
Browser-based submission of content types other than form are supported by
@@ -62,3 +79,4 @@ as well as how to support content types other than form-encoded data.
[rails]: http://guides.rubyonrails.org/form_helpers.html#how-do-forms-with-put-or-delete-methods-work
[html5]: http://www.w3.org/TR/html5-diff/#changes-2010-06-24
[put_delete]: http://amundsen.com/examples/put-delete-forms/
+[aws_elb]: https://forums.aws.amazon.com/thread.jspa?messageID=400724