2011/4/3 Shish <[email protected]>:
> According to this [1], PUT and DELETE are no longer supported as
> methods in HTML forms. In practice this seems like no great loss, as
> they were never implemented consistently anyway, and in some parts
> they were broken by design [2]; but in theory, these two methods are
> very useful. I know that pylons gets around this by allowing the
> parameter "_method" to override the actual HTTP method, so that you
> can use GET and POST as the HTTP-level transport protocol (as those
> two are well supported), and GET/POST/PUT/DELETE as the action (as
> those four are all useful). I've not found anything similar for web.py
> though -- is there anything?
There is no built-in support, but it is not hard to write one yourself.
app = web.application(...)
def post_override_processor(handler):
if web.ctx.method == "POST":
web.ctx.method = web.input(_method="POST")._method
handler()
app.add_handler(post_override_processor)
--
You received this message because you are subscribed to the Google Groups
"web.py" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/webpy?hl=en.