title: API URL call with PHP and cURL
body: <p>I'm hoping someone can help me out.</p>
  
  <p>I have an API call using this URL. </p>
  
  <pre><code>https://192.168.11.234:4444/webconsole/APIController?reqxml=&lt;Request&gt;&lt;Login&lt;Username&gt;XXXXX&lt;/Username&gt;&lt;Password&gt;XXXXX&gt;&lt;/Password&gt;&lt;/Login&gt;&lt;Get&gt;&lt;User&gt;&lt;Username&gt;manager&lt;/Username&gt;&lt;/User&gt;&lt;/Get&gt;&lt;/Request&gt;
  </code></pre>
  
  <p>This works fine and returns an XML as expected.</p>
  
  <p>However I'm attempting to do the same thing with PHP and cURL.</p>
  
  <p>I have very little experience with cURL </p>
  
  <p>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.</p>
  
  <pre><code>&lt;?php
  $input_xml = '&lt;Request&gt;&lt;Login&gt;&lt;Username&gt;XXXX&lt;/Username&gt;&lt;Password&gt;XXXX&lt;/Password&gt;&lt;/Login&gt;&lt;Get&gt;&lt;User&gt;&lt;/User&gt;&lt;/Get&gt;&lt;/Request&gt;';
  $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('&lt;pre&gt;');
  print_r($array_data);
  print_r('&lt;/pre&gt;');
  ?&gt;
  </code></pre>
  
  <p>I will admit I have not worked with cURL much, so I may be way off. </p>