GET请求:
<?php
$url='https://api2.biggeryun.com/v1/vmSelect?Signature=dfcbc0f95567adcba9a0bf455ef9d9b9&Local_Id=wuxi&Order=asc&Order_By=NAME&User_Id=2000000049';
$result = file_get_contents($url);
?>
POST请求:
function request_post($url = '', $param = '') {
if (empty($url) || empty($param)) {
return false;
}
$postUrl = $url;
$curlPost = $param;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$postUrl);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);//post提交方式
curl_setopt($ch, CURLOPT_POSTFIELDS, $curlPost);
$data = curl_exec($ch);//运行curl
curl_close($ch);
return $data;
}
$url = 'https://api2.biggeryun.com/v1/VmSelect';
$params = [
'User_Id' => '2000000049',
'Local_Id' => 'wuxi',
'Order'=>'asc',
'Order_By'=>'NAME',
'Signature'=>'dfcbc0f95567adcba9a0bf455ef9d9b9'
];
$result = request_post($url,$params);