Requests_Proxy_HTTP::curl_before_send() WordPress Method

The Requests_Proxy_HTTP::curl_before_send() method is used to modify the cURL request before it is sent. This can be useful for setting cURL options that are not directly exposed by the Requests_Proxy class. The first argument is the cURL resource, followed by an array of headers. The array keys are the header names, and the values are the header values.

Requests_Proxy_HTTP::curl_before_send( resource $handle ) #

Set cURL parameters before the data is sent


Parameters

$handle

(resource)(Required)cURL resource


Top ↑

Source

File: wp-includes/Requests/Proxy/HTTP.php

	public function curl_before_send(&$handle) {
		curl_setopt($handle, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
		curl_setopt($handle, CURLOPT_PROXY, $this->proxy);

		if ($this->use_authentication) {
			curl_setopt($handle, CURLOPT_PROXYAUTH, CURLAUTH_ANY);
			curl_setopt($handle, CURLOPT_PROXYUSERPWD, $this->get_auth_string());
		}
	}


Top ↑

Changelog

Changelog
VersionDescription
1.6Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.