I'm hoping someone can help me out.
I have an API call using this URL.
https://192.168.11.234:4444/webconsole/APIController?reqxml=<Request><Login<Username>XXXXX</Username><Password>XXXXX></Password></Login><Get><User><Username>manager</Username></User></Get></Request>
This works fine and returns an XML as expected.
However I'm attempting to do the same thing with PHP and cURL.
I have very little experience with cURL
So far I've tried variations of this but I get no response. only a blank page. wondering if maybe someone could help me out.
<?php
$input_xml = '<Request><Login><Username>XXXX</Username><Password>XXXX</Password></Login><Get><User></User></Get></Request>';
$url = "https://192.168.11.234:4444/webconsole/APIController";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POSTFIELDS,
"reqxml=" . $input_xml);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 300);
$data = curl_exec($ch);
curl_close($ch);
$array_data = json_decode(json_encode(simplexml_load_string($data)), true);
print_r('<pre>');
print_r($array_data);
print_r('</pre>');
?>
I will admit I have not worked with cURL much, so I may be way off.