What does php's CURLOPT_USERPWD do What does php's CURLOPT_USERPWD do curl curl

What does php's CURLOPT_USERPWD do


Is it modifying the url to this?:

username:password@someurl.com

No, the url still the same. You can check with

curl_getinfo($ch, CURLINFO_EFFECTIVE_URL);

This

$encodedAuth = base64_encode(self::$pfAdapterUser.":".self::$pfAdapterPasswd);curl_setopt($ch, CURLOPT_HTTPHEADER, array("Authorization: Basic ".$encodedAuth));

And this

curl_setopt($ch, CURLOPT_USERPWD, self::$pfAdapterUser.":".self::$pfAdapterPasswd);

are doing the same thing so there's no need to use them together (although it won't break), use one and it will work fine.