当前位置:网站首页>Express bird of Express query demonstration code (php+curl)
Express bird of Express query demonstration code (php+curl)
2022-06-22 09:03:00 【YUJIANYUE】
Use the official website DEMO unable file_get, So explore other solutions by yourself , The actual measurement is feasible
<?php
// Express bird payment interface of Express query demonstration code
// need kdniao.com The website registers and gets ApiKey EBusinessID
$Apiusr='1239100'; // Please amend EBusinessID The user ID
$ApiKey='56da2cf8-c8a2-44b2-b6fa-476cd7d1ba17'; // Please amend ApiKey
$Kdcoms="YTO";// Please modify the letter code of the express company
$Kdnums="yt1428578711***";// Please modify the express order No
$Apiurl='https://api.kdniao.com/Ebusiness/EbusinessOrderHandle.aspx';
$rData= "{'CustomerName': '','OrderCode': '','ShipperCode': '{$Kdcoms}','LogisticCode': '{$Kdnums}'}";
$datas = array();
$datas['EBusinessID'] = $Apiusr;
$datas['RequestType'] = "1002";
$datas['RequestData'] = $rData;
$datas['DataType'] = "2";
$datas['DataSign'] = urlencode(base64_encode(md5($rData.$ApiKey)));
$pdata = "";
foreach($datas as $tt=>$vv){$vv = urlencode($vv);$pdata .= "&{$tt}={$vv}";}
$pdata = Trim($pdata,"&");
$result=ccurl($Apiurl, $pdata);
echo "\r\n<br>result: ".$result;
function ccurl($url , $post) {
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_HEADER, 0);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 600);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt($curl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
if ($referer) {
curl_setopt($curl, CURLOPT_REFERER, $referer);
} else {
curl_setopt($curl, CURLOPT_AUTOREFERER, 1);
}
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
if (!empty($post)) {
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $post);
}
curl_setopt($curl, CURLOPT_COOKIE, '');
$nres = curl_exec($curl);
curl_close($curl);
if ($nres) {
return $nres;
}
}
?>边栏推荐
猜你喜欢

DOM编程
![Luogu p4292 [wc2010] reconstruction plan](/img/09/5417e0b62e5205c4dabf4571823492.png)
Luogu p4292 [wc2010] reconstruction plan

Use record of rabbit nest

Medical information management system database mysql

Thread.start()方法源码分析

Solidity from introduction to practice (III)

MSSQL injection of SQL injection
![In the monorepo learning, execute NPM run build to report error[err\u require\esm] of ES module](/img/76/ec4776bcd452584290ef8bf5d0e06f.jpg)
In the monorepo learning, execute NPM run build to report error[err\u require\esm] of ES module

Flask博客实战 - 实现文章管理

09 combination mode
随机推荐
07 适配器模式
Troubleshooting various errors when Navicat for MySQL connects to MySQL database
滴滴二面总结
Interview shock 59: can there be multiple auto increment columns in a table?
面试突击59:一个表中可以有多个自增列吗?
YOLOv5报错:AttributeError: ‘Upsample‘ object has no attribute ‘recompute_scale_factor‘ 的解决方案
14 responsibility chain mode
Pytorch oserror: DLL load failed: problem solving
关于EasyPoi导入Excel文件二级表头数据时@ExcelEntity实体类里的第一列数据为null的这档事
Continuous training on tensorflow breakpoint (principle + code explanation)
How much do you know about the required encryption industry terms in 2022?
19 memo mode
In the monorepo learning, execute NPM run build to report error[err\u require\esm] of ES module
19 备忘录模式
Basic knowledge of DDL operation database and operation table and explanation of use format
Deep learning - (1) RESNET implementation
Thread.start()方法源码分析
Share 830 spider IP segments (by analyzing 1g logs)
Originality: dozens of lines of pure PHP code decrypt goto encrypted PHP single file [for learning only]
12 yuan sharing mode