Probleme mit pycurl.POSTFIELDS

Ich bin vertraut mit CURL in PHP, bin aber zum ersten mal in Python pycurl.

Ich erhalte die Fehlermeldung:

Exception Type:     error
Exception Value:    (2, '')

Ich habe keine Ahnung, was dies bedeuten könnte. Hier ist mein code:

data = {'cmd': '_notify-synch',
        'tx': str(request.GET.get('tx')),
        'at': paypal_pdt_test
        }

post = urllib.urlencode(data)

b = StringIO.StringIO()

ch = pycurl.Curl()
ch.setopt(pycurl.URL, 'https://www.sandbox.paypal.com/cgi-bin/webscr')
ch.setopt(pycurl.POST, 1)
ch.setopt(pycurl.POSTFIELDS, post)
ch.setopt(pycurl.WRITEFUNCTION, b.write)
ch.perform()
ch.close()

Der Fehler bezieht sich auf die Zeile ch.setopt(pycurl.POSTFIELDS, post)

InformationsquelleAutor Matt McCormick | 2010-01-06

Schreibe einen Kommentar