//HTTP请求(支持HTTP/HTTPS,支持GET/POST)
public static function http_request(data = null, data_binary = null, upw = null, init_call = null,$CUSTOMREQUEST = null)
{
//usleep(15*1000);
$curl = curl_init();
curl_setopt(url);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
if($CUSTOMREQUEST){
curl_setopt(CUSTOMREQUEST);
}
if($upw){
curl_setopt(upw['user'] . ":" . $upw['pw']);
}
if($auto_proxy && USE_PROXY){
curl_setopt($curl, CURLOPT_PROXY, CommonApi::PROXY_IP); //代理服务器地址
curl_setopt($curl, CURLOPT_PROXYPORT, CommonApi::PROXY_PORT); //代理服务器端口
}
if(!empty($data_binary)){
curl_setopt($curl, CURLOPT_POST, 1);
$stream = fopen('php://memory','r+');
fwrite(data_binary );
stream);
rewind($stream);
curl_setopt(stream);
curl_setopt(dataLength);
curl_setopt($curl,CURLOPT_UPLOAD,1);
}
else if (!empty($data)) {
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt(data);
}
if ($header) {
curl_setopt(header);
}
if($get_header){
curl_setopt($curl, CURLOPT_HEADER, true);
}
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
// curl_setopt($curl, CURLINFO_HEADER_OUT, true);
if($init_call){
curl);
}
curl);
curl_close($curl);
return $output;
}
}