if ( $proxy->
is_enabled() &&
$proxy->
send_through_proxy( $url ) ) { $options['proxy'
] =
new WpOrg\Requests\Proxy\
Http( $proxy->
host() . ':' .
$proxy->
port() );
if ( $proxy->
use_authentication() ) { $options['proxy'
]->use_authentication = true;
$options['proxy'
]->user =
$proxy->
username();
$options['proxy'
]->pass =
$proxy->
password();
} } // Avoid issues where mbstring.func_overload is enabled.
mbstring_binary_safe_encoding();
try { $requests_response = WpOrg\Requests\Requests::
request( $url,
$headers,
$data,
$type,
$options );
// Convert the response into an array.
$http_response =
new WP_HTTP_Requests_Response( $requests_response,
$parsed_args['filename'
] );
$response =
$http_response->
to_array();
// Add the original object to the array.
$response['http_response'
] =
$http_response;
} catch ( WpOrg\Requests\Exception
$e ) {