首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >OCR-通用印刷体识别报错,check content-type and body’ ?

OCR-通用印刷体识别报错,check content-type and body’ ?

提问于 2018-07-27 16:11:36
回答 1关注 0查看 1K

使用 python 请求OCR识别,报错如下:

{'message': 'invalid request: parsing error - check content-type and body', 'data': {}, 'httpcode': 400, 'code': 3}

代码部分如下:

代码语言:javascript
复制
requrl = 'http://recognition.image.myqcloud.com/ocr/general'
headers = {
    'host': 'recognition.image.myqcloud.com',
    'authorization': self._auth.get_sign(self._bucket),
    'content-type': 'application/json',
}
files = {
    'appid': self._auth._appid,
    'bucket': self._bucket,
}
files['image'] = picture
return Http.post(requrl, headers=headers, data=files, timeout=self._conf.timeout())

这个是什么问题: headers字典的键值尝试过 'Host'、'Content-Type'等大写开头,错误相同。

相关文章

相似问题

相关问答用户
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档