Stephan Richter wrote:
Hi you two,
in the SchoolTool project, we have the need to sometimes use different HTTP
verbs to send data somewhere. Browser.open only supports sending data, but
does not allow changing the HTTP verb. I checked mechanize and it does not
support it either. Do you guys have any idea on how to solve the problem?
I don't think it would be too hard to do because mechanize uses the
Python stdlib to do its communication, which I supports using methods
other than GET. It would require coordination with John J. Lee, and
neither Gary nor I would have time to do that for a while.
I would like to support a "verb" keyword in open and either extend mechanize
to support it too or have an alternative way of doing this, if the verb does
not equal GET.
I really want to use testbrowser for this, since it is more consistent and I
can better see which user sent the data.
One problem is that you'll have to also add a body parameter to actually
get the content into the request.
Philosophically testbrowser is about simulating a browser, and in this
case you want to simulate something that browsers don't do (PUTs of
calendar data). Therefore I really don't like the verb/body extension.
I do see the annoyance with a continuity loss when using the "http"
function to do the PUT, but the code itself is very clear; I like your
Senior Software Engineer
Zope3-dev mailing list