我使用的是fullcontact person enrich API,但运行该程序时出现以下错误:
'TypeError:POST数据应为字节、字节的iterable或文件对象。它不能是str类型
我已经尝试过对数据进行编码,但还没有找到确切的方法。见下面的代码:
import urllib.request
import json
req = urllib.request.Request('https://api.fullcontact.com/v3/person.enrich')
req.add_header('Authorization', 'Bearer {your api key}')
data = json.dumps({
"emails": [
"example@fullcontact.com"
]
})
response = urllib.request.urlopen(req,data)
目前没有回答
相关问题 更多 >
编程相关推荐