When I put all my authorization data into
data = {
'token': 'XXXXXXXXXXXXXXXXXXXXXXXXXXX',
'content': 'file',
'action': 'import',
'record': '',
'field': 'record_id',
'event': '',
'returnFormat': 'csv',
'file': '(pycurl.FORM_FILE, file)'
}
I get error at
h.setopt(ch.HTTPPOST, data.items())
which says
ch.setopt(ch.HTTPPOST, data.items()) TypeError: invalid arguments to setopt`
The rest of the code:
ch.setopt(ch.POST, 1)
ch.setopt(ch.SSL_VERIFYPEER, 0)
ch.setopt(ch.HTTPPOST, data.items())
ch.setopt(ch.WRITEFUNCTION, e.write)
ch.perform()