[Twisted-Python] Re: Post data

Matteo Giacomazzi matteo.giacomazzi at libero.it
Mon Oct 27 12:47:13 MST 2003


UPDATE:  I  forgot  to  use  the  method='POST'  keyword param, but no
results yet...

#==========================================================
from twisted.web.client import getPage
from twisted.internet import reactor
import urllib

def printData(data):
    print data
    reactor.stop()

payload = urllib.urlencode({'test':'the test'})
url = 'http://www.hotelsprovider.com/~matteo'
d = getPage(url, method='POST', postdata=payload, timeout=5)
d.addCallback(printData)
reactor.run()
#==========================================================

Many thanks in advance!
  

Kind regards
 Matteo





More information about the Twisted-Python mailing list