本文主要是介绍网民用户身份信息实名认证-身份证号+姓名实名认证 GO语言接口代码,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
翔云身份证二要素实名认证接口,是保护网民数字身份安全的重要防线,更是人们心中守护信息安全的坚实盾牌。有效阻止了网民信息泄露。
以下是go语言调用翔云身份证号实名认证API的代码:
package mainimport ("fmt""bytes""mime/multipart""net/http""io/ioutil"
)func main() {url := "https://netocr.com/verapi/veridenNoOrd.do"method := "POST"payload := &bytes.Buffer{}writer := multipart.NewWriter(payload)_ = writer.WriteField("key", "M***********g")_ = writer.WriteField("secret", "3***********6")_ = writer.WriteField("typeId", "3009")_ = writer.WriteField("trueName", "陈**")_ = writer.WriteField("idenNo", "13***************3")_ = writer.WriteField("format", "json")err := writer.Close()if err != nil {fmt.Println(err)return}client := &http.Client { }req, err := http.NewRequest(method, url, payload)if err != nil {fmt.Println(err)return}req.Header.Set("Content-Type", writer.FormDataContentType())res, err := client.Do(req)if err != nil {fmt.Println(err)return}defer res.Body.Close()body, err := ioutil.ReadAll(res.Body)if err != nil {fmt.Println(err)return}fmt.Println(string(body))
}
这篇关于网民用户身份信息实名认证-身份证号+姓名实名认证 GO语言接口代码的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!