Just a warning about urllib and Zope from previous experience. If you're not sure of the reliability of the server that will be receiving your urllib requests, be cautious. We used urllib to hit another server and experienced really bad hanging and timeout problems. The external methods would start hanging and eventually slow Zope to a crawl or a stop. There's a timeoutsocket module for Python that lets you set a timeout on a request that's probably worth using even if you do trust the other server not to time out on you--you never know what network factors will work against you! It's at http://www.timo-tasi.org/python/timeoutsocket.py -- Chris On Thursday, March 6, 2003, at 02:08 AM, Ed Colmar wrote:
Hi AM and zope cru!
Here is the quick external method I built to do this...
If anyone is familiar with urllib and can tell me if I need to do something different I'd appreciate it!
def formsender(self, completeurl): """ This method is used to transparently send form data to an external server
completeurl is the entire url including form field values.""" import urllib result = urllib.URLopener().open(completeurl) urllib.URLopener().close()
On Wed, 5 Mar 2003, AM wrote:
Unless the other server returns to a page on your site, the only thing you can probably do is to use and external method that uses something like wget/lynx to post the data and get somthing back to be parsed by the method.
hth AM
Ed Colmar wrote:
Hi fellow zope hackers!
I'm building a site for someone who wants to have the entire site within zope, to connect to dbs, etc... But they use a service that requires them to post form data to a master server.
Is there an easy way (in dtml or python) to do this without seeing the data transfer or ending up at th other server's pages?
So far I've considered making an external method that uses lynx and dumps the return data. Is this the best way?
Thanks for the help!
-ed-
-- Green Graphics ::: Print and Web Design ::: 510.923.0000
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )