我一直试图通过PHP
来获取网址$url = "http://XXXX/job/Clone_CentOS_VM/buildWithParameters?token=XXXX&vm_user=$login&memory_mb=$memory&num_cpus=$cpuð0_ip=$ip_172ð1_ip=$ip_192";
现在我们有'&',它正在用'& amp'替换它,因为我的误差低于此。
Warning: file(http://XXXX/job/Clone_CentOS_VM/buildWithParameters?token=XXXXX&vm_user=vnitin&memory_mb=XX&num_cpus=XX&eth0_ip=XX&eth1_ip=XX): failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden
这是代码(我尝试了所有可能的选项)
// $ch = curl_init();
// curl_setopt($ch, CURLOPT_URL, $url);
// curl_setopt($ch, CURLOPT_HEADER, 0);
// curl_exec($ch);
// curl_close($ch);
#$newurl = iconv('UTF-8','cp1251',$url);
$payload = file($url);
任何想法,如何解决?