Allow PUT and DELETE to tunnel over POST
Project description
From the pydoc:
A TiddlyWeb plugin for working around limitations in some server setups
wherein perfectly legit HTTP methods like PUT and DELETE are not allowed
to pass through to TiddlyWeb.
This can also happen when using some legacy browsers which will not
allow PUT and DELETE in XmlHttpRequest calls.
We do this by looking at, in order:
X-HTTP-Method header
http_method URL parameter
If the real method is POST, REQUEST_METHOD will be reset to whatever is
given in the above.
If the real method is GET, REQUEST_METHOD will only be reset to whatever
is given in the above if it is GET or HEAD.
Effectively this means that if you want to override, you must POST. This
is consistent with idempotency conventions associated with HTTP methods.
ONLY USE THIS MIDDLEWARE IF YOU CANNOT FIX YOUR SERVER OR YOUR BROWSER.
YOUR SERVER AND BROWSER ARE BROKEN IF YOU NEED TO USE THIS.
NOTE: This code will not magically handle tunneling of methods. Client
code must choose to do the tunneling. At this time TiddlyWeb client code
such as TiddlyWebAdaptor does NOT tunnel. methodhack provides a way to
hand PUT and DELETE requests that have been tunneled over POST for those
browsers that do not support PUT and DELETE. It handles clients that
support a protocol defined in the docs.
N.B.: When using this with TiddlyWebWiki, a client-side component is
required as well. To this end, the following jQuery plugin can be used
as a TiddlyWiki plugin:
http://github.com/FND/jquery/blob/master/jquery.methodhack.js
A TiddlyWeb plugin for working around limitations in some server setups
wherein perfectly legit HTTP methods like PUT and DELETE are not allowed
to pass through to TiddlyWeb.
This can also happen when using some legacy browsers which will not
allow PUT and DELETE in XmlHttpRequest calls.
We do this by looking at, in order:
X-HTTP-Method header
http_method URL parameter
If the real method is POST, REQUEST_METHOD will be reset to whatever is
given in the above.
If the real method is GET, REQUEST_METHOD will only be reset to whatever
is given in the above if it is GET or HEAD.
Effectively this means that if you want to override, you must POST. This
is consistent with idempotency conventions associated with HTTP methods.
ONLY USE THIS MIDDLEWARE IF YOU CANNOT FIX YOUR SERVER OR YOUR BROWSER.
YOUR SERVER AND BROWSER ARE BROKEN IF YOU NEED TO USE THIS.
NOTE: This code will not magically handle tunneling of methods. Client
code must choose to do the tunneling. At this time TiddlyWeb client code
such as TiddlyWebAdaptor does NOT tunnel. methodhack provides a way to
hand PUT and DELETE requests that have been tunneled over POST for those
browsers that do not support PUT and DELETE. It handles clients that
support a protocol defined in the docs.
N.B.: When using this with TiddlyWebWiki, a client-side component is
required as well. To this end, the following jQuery plugin can be used
as a TiddlyWiki plugin:
http://github.com/FND/jquery/blob/master/jquery.methodhack.js
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for tiddlywebplugins.methodhack-0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e41fb0ff51c4041a85f54785db9318aab754f82ced7e42f8d892174a5ff56eb |
|
MD5 | 954060a5e250aa356dfc8682c7d5cf4a |
|
BLAKE2b-256 | 38841f2242938786d7fc1c28689c32a5a864522a35831a2551673a1d10362e93 |