/**
* Send POST request
* @author jiafeimao&dabai
* @createtime 2017-07-26 14:06:04
* @param string $u RL Request Address
* @param array $post _data post key value pair data
* @return string
*/
Function Https_request ($url, $data =null {
header ("content-type:text/html; Charset=utf-8 ");
$ch = Curl_init ();
curl_setopt ($ch, Curlopt_url, $url);
curl_setopt ($ch, Curlopt_customrequest, "POST");
curl_setopt ($ch, Curlopt_ssl_verifypeer, FALSE);
curl_setopt ($ch, Curlopt_ssl_verifyhost, FALSE);
curl_setopt ($ch, Curlopt_useragent, ' mozilla/5.0 (compatible; MSIE 5.01; Windows NT 5.0) ');
curl_setopt ($ch, curlopt_followlocation, 1);
curl_setopt ($ch, Curlopt_autoreferer, 1);
curl_setopt ($ch, Curlopt_postfields, $data);
curl_setopt ($ch, Curlopt_returntransfer, true);
$tmpInfo = curl_exec ($ch);
if (Curl_errno ($ch)) {
return curl_error ($ch);
}
Curl_close ($ch);
return $tmpInfo;
}
PHP send POST request HTTPS type