curl访问https接口
$url = "https://test.idiot.com/preregister/data?phone=15756892356" ;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
$result = curl_exec($ch);
print_r($result);图片点击直接下载
1.后端返回加上header头:
header('Content-type: image/png')header("Content-Disposition: attachment; filename='xxxx.png'")
2.前端:a标签属性加上download属性
eg:<a href="large.jpg" download>下载</a>