Apparently, this already is a known issue on GitHub. Still open and not patched from May 16, 2016.
Based on the suggestion from the comments, creating a new Hooks
instance and registering the hook curl.before_multi_add
with a callback that sets the cURL
authentication options should solve the [401] Unauthorized Access problem.
use WpOrg\Requests\Hooks;
$hooks = new Hooks();
$hooks->register( 'curl.before_multi_add', function( &$curl_subhandle ) {
// curl_setopt can fail => Still [401] then, so take care of that
curl_setopt( $curl_subhandle, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt( $curl_subhandle, CURLOPT_USERPWD, YOUR_CK . ":" . YOUR_CS );
});
Afterwards, set the following in the $options
array:
$options []= 'hooks' => $hooks;