unset( $parsed_args['headers'
]['user-agent'
] );
} // Construct Cookie: header if any cookies are set.
WP_Http::
buildCookieHeader( $parsed_args );
$handle =
curl_init();
// cURL offers really easy proxy support.
$proxy =
new WP_HTTP_Proxy();
if ( $proxy->
is_enabled() &&
$proxy->
send_through_proxy( $url ) ) { curl_setopt( $handle, CURLOPT_PROXYTYPE, CURLPROXY_HTTP
);
curl_setopt( $handle, CURLOPT_PROXY,
$proxy->
host() );
curl_setopt( $handle, CURLOPT_PROXYPORT,
$proxy->
port() );
if ( $proxy->
use_authentication() ) { curl_setopt( $handle, CURLOPT_PROXYAUTH, CURLAUTH_ANY
);
curl_setopt( $handle, CURLOPT_PROXYUSERPWD,
$proxy->
authentication() );
} }