// 明明用post请求更好 不知道为啥要用get请求 咱也不敢问
/**
* 发送get请求
*/
public function curlget(){
$url = "api.test.com/info/getDeviceNetworkState";
$params = json_encode(array(
"APPID"=>"",
"devID"=>""
));
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($params)
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
$res = json_decode(curl_exec($ch));
curl_close($ch);
var_dump($res);
}