本文为您提供了Go语言版本的提交查询接口对接DEMO示例
//测试:go run ./test.go
package main
import (
"fmt"
"io/ioutil"
"net/http"
"net/url"
"strings"
)
const strUrl = "https://api.ihuyi.com/idcard/id2mv2/Submit.json"
func main() {
v := url.Values{}
v.Set("account", "xxxxxxxx") //APIID(用户中心【认证核验】-【身份信息验证】-【产品总览】查看)
v.Set("password", "xxxxxxxxx") //1、APIKEY(用户中心【认证核验】-【身份信息验证】-【产品总览】查看)
2、动态密码(生成动态密码方式请看该文档末尾的说明)
v.Set("name", "7dfc34e671eb701d999bae9b74de8f09三") //身份证姓名(第一个字替换为32位小写md5值)
v.Set("id_card_no", "***7521bc5b2c1c997e59f4d8352d070e2f****") //身份证号码(生日替换为32位小写md5值)
v.Set("time", "1623643787") //Unix时间戳(10位整型数字,当使用动态密码方式时为必填)
body := strings.NewReader(v.Encode()) //把form数据编码
client := &http.Client{}
req, _ := http.NewRequest("POST", strUrl, body)
req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
resp, err := client.Do(req) //发送
if err != nil {
fmt.Println(err)
}
defer resp.Body.Close() //一定要关闭resp.Body
res, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(res))
}
国内专业互联网团队
21年行业经验
7x24小时售后支持
丰富的行业经验
Copyright © 2004-2025 上海思锐信息技术有限公司 All rights reserved. 沪ICP备07035915号-15 电信增值业务许可证:B2-20160082
服务热线:
4008 808 898
服务热线(工作时间):
4008 808 898
业务咨询(非工作时间):
售后咨询(非工作时间):