翔云身份证二要素实名认证接口,是保护网民数字身份安全的重要防线,更是人们心中守护信息安全的坚实盾牌。有效阻止了网民信息泄露。
以下是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))
}