title: How to use Qualys API v2 with PHP?
body: <p>I am trying to use the Qualys API v2 to get an xml host list returned. I think you must use cURL, but I am unfamiliar with it. Here is my code:</p>
  
  <pre><code>$ch = curl_init();
  curl_setopt($ch, CURLOPT_HEADER, 1);
  curl_setopt($ch, CURLOPT_USERPWD, "$username:$password");
  curl_setopt($ch, CURLOPT_URL, "https://qualysapi.qualys.com/api/2.0/fo/asset/host/?action=list&amp;details=Basic");
  curl_setopt($ch, CURLOPT_HTTPHEADER, array('X-Requested-With: Manitowoc Service Account'));
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
  
  $xml = curl_exec($ch);
  curl_close();
  $hostobj = simplexml_load_string($xml);
  </code></pre>