OCR-身份证识别提示{"code":3,"message":"invalid request"}?

  • 回答 (3)
  • 关注 (0)
  • 查看 (143)

OCR-身份证识别,提示错误

请求报文如下:

POST /ocr/idcard HTTP/1.1

Content-Type: multipart/form-data

Authorization: wWTQOF8HGlNJZKeQSeoUgI4u30hhPTEyNTU1NTI3NzAmYj10ZXN0Jms9QUtJRHkwUWpReW5ZWk56U2txU2lqZE51TGV3NTV1OEhSMVRrJnQ9MTUyNzU5NjYxMSZlPTE1Mjc1OTY5MTEmcj02MzU5Njc2MTI=

host: recognition.image.myqcloud.com

Content-Type: multipart/form-data

Transfer-Encoding: chunked

Connection: Keep-Alive

User-Agent: Apache-HttpClient/4.5.2 (Java/1.8.0_161)

Accept-Encoding: gzip,deflate

61

--_btPBQUZ5F5WECUF2Bj27P0AMh4RyAdi-Dg46LZu

Content-Disposition: form-data; name="bucket"

test

68

--_btPBQUZ5F5WECUF2Bj27P0AMh4RyAdi-Dg46LZu

Content-Disposition: form-data; name="appid"

1255552770

63

--_btPBQUZ5F5WECUF2Bj27P0AMh4RyAdi-Dg46LZu

Content-Disposition: form-data; name="card_type"

1

109b

--_btPBQUZ5F5WECUF2Bj27P0AMh4RyAdi-Dg46LZu

Content-Disposition: form-data; name="image[0]"; filename="1.jpg"

Content-Type: image/jpeg

返回信息如下

HTTP/1.1 400 Bad Request

Server: nginx

Date: Tue, 29 May 2018 12:23:49 GMT

Content-Type: application/json; charset=utf-8

Content-Length: 38

Connection: keep-alive

{"code":3,"message":"invalid request"}

用户1341125用户1341125提问于
用户1341125回答于

已解决,请求头缺少boundary,使用httpclient发送Multipart请求时,不能添加multipart/form-data head,multipartentiry默认自动加上

列车回答于
姐姐专注写bug回答于

所属标签

可能回答问题的人

  • Y. Ji

    5 粉丝0 提问1 回答
  • Superbeet

    4 粉丝0 提问0 回答
  • 莫烦

    2 粉丝0 提问0 回答
  • 罗罗可爱多

    腾讯 · 高级研究员 (已认证)

    8 粉丝0 提问4 回答
  • 晏栋栋栋

    1 粉丝0 提问1 回答
  • daiye

    1 粉丝0 提问0 回答

扫码关注云+社区

领取腾讯云代金券