php curl
<br /> //http请求头设置<br /> $header[] ="Content-Type: text/xml; charset=utf-8";<br /> $header[] ="User-Agent: Apache/1.3.26 (Unix)";<br /> $header[] ="Host: 192.168.101.230";<br /> $header[] ="Co
//http请求头设置
$header[] ="Content-Type: text/xml; charset=utf-8";
$header[] ="User-Agent: Apache/1.3.26 (Unix)";
$header[] ="Host: 192.168.101.230";
$header[] ="Connection: keep-alive";
$header[] ="Content-Length: ".strlen($acContent);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $acContent);//报文内容
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1); //启用ssl方式
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$res = curl_exec($ch);
curl_close($ch);
更多推荐
所有评论(0)