PHP中的UIDAI Adhaar API

时间:2017-01-09 17:42:13

标签: php api

$curl = curl_init();
$xml_data = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  <Auth uid=”999999990019” tid=”public” ac=”public” sa=”public” ver=”1.6”txn=”AuthDemoClient:public:20160616070338756” lk=”MBFWjkJHNFfLidl8oOHtUwgL5p1ZjDbWrqsMEVEJLVEDpnlNj_CZTg”>
    <Uses pi=”y” pa=”n” pfa=”n” bio=”n” bt=”n” pin=”” otp=”n”/>
    <Tkn type=”” value=””/>
    <Meta udc=”” fdc=”” idc=”” pip=”” lot=”G|P” lov=””/>
    <Skey ci=”” ki=””></Skey>
    <Data type=”X|P”>encrypted PID block</Data>
    <Hmac>SHA-256 Hash of Pid block, encrypted and then encoded</Hmac
    <Signature>Digital signature of AUA</Signature>
  </Auth>
</xml>'; 
curl_setopt($curl, CURLOPT_URL,"http://auth.uidai.gov.in/1.6/public/9/9/MH4hSkrev2h_Feu0lBRC8NI-iqzT299_qPSSstOFbNFTwWrie29ThDo");
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: text/xml','Content-Length:length'));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $xml_data);
$result = curl_exec($curl);
curl_close($curl);
print_r($result);

这是我写的示例代码。需要测试一些遗留属性的测试数据,如 udc,fdc,idc 等。当我尝试触发此API时, 400-错误的请求。帮助会受到影响。

0 个答案:

没有答案