function priceLcsInfo()
{
$data = array(
'code'=>'lcs',
'token'=>'',
'webp'=>1,
);
$json = json_encode($data);
$url = 'https://mdncapi.bqiapp.com/api/coin/web-coininfo';
$options = array(
"ssl" => [
"verify_peer"=>false,
"verify_peer_name"=>false,
],
'http' => array(
'method' => 'POST',
'header' => 'Content-type:application/json', 'Content-Length: ' . strlen($json),
'content' => $json,
'timeout' => 15 * 60 // 超时时间(单位:s)
)
);
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
$print_info = json_decode($result,true);
$info = $print_info['data']['price'];
return $info;
}
发送POST请求数据,传递json数据进行获取结果
最新推荐文章于 2022-09-14 16:27:53 发布