title: cURL with both Basic and Bearer authentication headers
body: <p>I'm using PHP cURL to test an API which sits on a dev site that is protected by Apache HTPASSWD.</p>
  
  <pre><code>$jwt = // a standard JWT token        
  
  $curl = curl_init();
  curl_setopt($curl, CURLOPT_URL, 'https://dev.mysite.com/api');
  curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
  curl_setopt($curl, CURLOPT_USERPWD, 'myuser:mypass');
  curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/json', 'Authorization: Bearer '.$jwt));
  curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
  $output = curl_exec($curl);
  </code></pre>
  
  <p>However, it seems that setting the HTTPHEADER overrides the Basic authentication needed for HTPASSWD, as the calls return a 401 UNAUTHORIZED.</p>
  
  <p>I have also tried (without success):</p>
  
  <pre><code>curl_setopt($curl, CURLOPT_URL, 'https://myuser:mypass@dev.mysite.com/api');
  </code></pre>
  
  <p>Is there a way I can include both of these header values in the API call using cURL? Or is there something else I'm doing wrong here?</p>