Python &引用;ch.setopt(ch.HTTPPOST,data.items())类型错误:setopt的参数无效;我得到了这个错误

Python &引用;ch.setopt(ch.HTTPPOST,data.items())类型错误:setopt的参数无效;我得到了这个错误,python,curl,pycurl,file-import,Python,Curl,Pycurl,File Import,当我将所有授权数据放入 data = { 'token': 'XXXXXXXXXXXXXXXXXXXXXXXXXXX', 'content': 'file', 'action': 'import', 'record': '', 'field': 'record_id', 'event': '', 'returnFormat': 'csv', 'file': '(pycurl.FORM_FILE, file)' } 我在 h.setopt(ch.HTTPPOST,

当我将所有授权数据放入

data = {
  'token': 'XXXXXXXXXXXXXXXXXXXXXXXXXXX',
  'content': 'file',
  'action': 'import',
  'record': '',
  'field': 'record_id',
  'event': '',
  'returnFormat': 'csv',
  'file': '(pycurl.FORM_FILE, file)'
}
我在

h.setopt(ch.HTTPPOST, data.items())
上面说

ch.setopt(ch.HTTPPOST,data.items()) TypeError:setopt的参数无效`

代码的其余部分:

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()

看起来很清楚。API文档对
h
是怎么说的?因为我们不知道什么是h,其他人也无能为力。其与问题相关的ch.setopt(ch.HTTPPOST,data.items())详细信息应在问题文本中。你可以提问并添加细节。但是什么类型的东西是
ch