我想读取的数据的网址是百度云上身份证识别的一个地址:
https://aip.baidubce.com/rest/2.0/ocr/v1/idcard?access_token=24.3074598030d473298e5197a463dd4a7f.2592000.1504252081.282335-9863126
需要传上的参数是:
id_card_side:front(代表身份证正面)back(代表身份证反面)
image:【图片Base64编码,需encodeURIComponent()】
正常访问参数传正确的数据:
{
"log_id": 525464404,
"words_result_num": 6,
"image_status": "normal",
"words_result": {
"住址": {
"location": {
"width": 337,
"top": 320,
"height": 75,
"left": 176
},
"words": "山东省五莲县城关沿河路398号6号楼3单元205室"
},
"出生": {
"location": {
"width": 0,
"top": 0,
"height": 0,
"left": 0
},
"words": "19871116"
},
"姓名": {
"location": {
"width": 92,
"top": 91,
"height": 33,
"left": 183
},
"words": "权志龙"
},
"公民身份号码": {
"location": {
"width": 444,
"top": 512,
"height": 32,
"left": 341
},
"words": "371121198711160018"
},
"性别": {
"location": {
"width": 0,
"top": 0,
"height": 0,
"left": 0
},
"words": "男"
},
"民族": {
"location": {
"width": 23,
"top": 169,
"height": 28,
"left": 391
},
"words": "汉"
}
}
}
我需要识别出来的数据,js的代码怎么去写呢?