当前位置:网站首页>Missing API interface actual development series (14): ID card real name authentication verification
Missing API interface actual development series (14): ID card real name authentication verification
2022-07-01 07:35:00 【Missed engraving sometimes】
Project requirements
Incoming name 、 ID number , Check whether the two elements are consistent , Return to birthday at the same time 、 Gender 、 Native place and other information .
Project request
function getCard($idcard, $name)
{
$host = "https://eid.shumaidata.com";
$path = "/eid/check";
$method = "POST";
$appcode = "a277cc985ba54c388e72deb135d45e9d";
$headers = array();
array_push($headers, "Authorization:APPCODE " . $appcode);
$querys = "idcard=" . $idcard . "&name=" . urlencode($name);
$url = $host . $path . "?" . $querys;
$curl = curl_init();
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_FAILONERROR, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_HEADER, false);
if (strpos("$" . $host, "https://") == 1) {
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
}
$output = rtrim(curl_exec($curl), 1);// Delete extra characters at the end ;
curl_close($curl);
return json_decode($output, true);
}
matters needing attention
Extra character processing
rtrim(curl_exec($curl), 1);// Official interface passed $curl Crawling over the contents , End exists “1” Such abnormal data , The result is that it cannot be parsed properly . adopt rtrim Function to delete extra characters at the end .
API rigorism
Different ID number with the same name will also be approved .
@lockdata.cn
边栏推荐
猜你喜欢

Warm congratulations on the successful listing of five elements hehe liquor

Unity2021-Scene视图中物体无法直接选中的解决办法

We found a huge hole in MySQL: do not judge the number of rows affected by update!!!

Discussion on several research hotspots of cvpr2022

软件测试方法和技术 - 基础知识概括

电脑有网络,但所有浏览器网页都打不开,是怎么回事?

Redisson utilise la solution complète - redisson Documents officiels + commentaires (Partie 1)
![[programming training 2] sorting subsequence + inverted string](/img/96/87750c5d3954ef6c39cce073e8b9ae.png)
[programming training 2] sorting subsequence + inverted string

热烈祝贺五行和合酒成功挂牌
![[target detection] yolov5, the shoulder of target detection (detailed principle + Training Guide)](/img/47/80d2e92ea7347cc5c7410194d5bf2e.png)
[target detection] yolov5, the shoulder of target detection (detailed principle + Training Guide)
随机推荐
[programming training 2] sorting subsequence + inverted string
1286_ Implementation analysis of task priority setting in FreeRTOS
Summary of the concept and advantages of 5g massive MIMO
Paging in servlets and JSPS
go-etcd
Apple account password auto fill
How to create an exclusive vs Code theme
Is it reliable to open an account on the compass with your mobile phone? Is there any potential safety hazard
MATLAB之基础知识
良心安利万向轮 SolidWorks模型素材网站
软件测试方法和技术 - 基础知识概括
C# Newtonsoft.Json中JObject的使用
2022茶艺师(初级)操作证考试题库及模拟考试
PWN攻防世界int_overflow
Eigen matrix operation Library
2022 test question bank and simulation test of tea master (primary) operation certificate
C# 读写自定义的Config文件
2022电工(中级)复训题库及答案
2022 operation of refrigeration and air conditioning equipment operation of national question bank simulated examination platform
Those high-frequency written tests and interview questions in [Jianzhi offer & Niuke 101] - linked list