title: What does php's CURLOPT_USERPWD do
body: <p>I was wondering what <a href="http://www.php.net/manual/en/function.curl-setopt.php" rel="noreferrer">CURLOPT_USERPWD</a> is actually doing to the url, header or data of a request. Is it INSTEAD OF the <code>Authorization: Basic &lt;base64 of user:pass&gt;</code> or does it work along side this?</p>
  
  <p>Is it modifying the url to this?:</p>
  
  <p><code>username:password@someurl.com</code></p>
  
  <p>I saw some code like this so I am wondering, as it seems if I request that url in a NodeJS equivalent request it is not working with just an Authorization header (I have a theory the server is broken and ignoring the Auth header and using the username:password in the url):</p>
  
  <pre><code>    curl_setopt($ch, CURLOPT_URL, $url); 
  
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
  
      $encodedAuth = base64_encode(self::$pfAdapterUser.":".self::$pfAdapterPasswd);
  
      curl_setopt($ch, CURLOPT_HTTPHEADER, array("Authentication : Basic ".$encodedAuth));
      curl_setopt($ch, CURLOPT_USERPWD, self::$pfAdapterUser.":".self::$pfAdapterPasswd);
      curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
      curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
      curl_setopt($ch, CURLINFO_HEADER_OUT, true);
  </code></pre>
  
  <p>Thanks</p>