时间:2021-07-01 10:21:17 帮助过:20人阅读
这个地址用get怎么提交
例如:http://localhost/openapi/holiday/Line/Query/GetLineComment?AllianceId=12&DigitalSign=7aeac3d1c621c30c144f23b5a498bbda01895b70&ReqTime=2013-09-02 16:23:49.929
这个地址用get怎么提交
curl 默认就是以 GET 提交的,如果为POST提交,请检查是否配置了 curl_setopt($c, CURLOPT_POST, 1); 这个参数
/**
* GET 请求
* @param string $url
*/
private function http_get($url){
$oCurl = curl_init();
if(stripos($url,"https://")!==FALSE){
curl_setopt($oCurl, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($oCurl, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($oCurl, CURLOPT_SSLVERSION, 1); //CURL_SSLVERSION_TLSv1
}
curl_setopt($oCurl, CURLOPT_URL, $url);
curl_setopt($oCurl, CURLOPT_RETURNTRANSFER, 1 );
//增加代理
//curl_setopt($oCurl, CURLOPT_PROXY, HTTP_PROXY_IP_PORT);
$sContent = curl_exec($oCurl);
$aStatus = curl_getinfo($oCurl);
curl_close($oCurl);
if(intval($aStatus["http_code"])==200){
return $sContent;
}else{
return false;
}
}
file_get_contents