Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 214147

Re: Issue submitting API requests via CURL! Help please!

$
0
0

Hi i had the same problem, i see thats your problem was in 2010, anyway i resolve this problem adding  this code in the setopt section:


 

$tmpfname = /tmp/cookie.txt;  

curl_setopt($curlHandle, CURLOPT_COOKIEJAR, $tmpfname);

curl_setopt($curlHandle, CURLOPT_COOKIEFILE, $tmpfname);

 

curl_setopt($curlHandle, CURLOPT_TIMEOUT, 30);

curl_setopt($curlHandle, CURLOPT_URL, $this->url.$this->operation);

curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true);

curl_setopt($curlHandle, CURLOPT_SSL_VERIFYPEER , false );//Since I am requesting https

curl_setopt($curlHandle, CURLOPT_SSL_VERIFYHOST , false );//Since I am requesting https

$header     = '';

$header[] = "Accept: application/xml";

$header[] = "Content-type: text/xml";

curl_setopt($curlHandle, CURLOPT_HTTPHEADER, $header);

curl_setopt($curlHandle, CURLINFO_HEADER_OUT, true);   


Viewing all articles
Browse latest Browse all 214147

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>