WpOrg\Requests\Transport

Curl::get_subrequest_handle()publicWP 1.0

Get the cURL handle for use in a multi-request

Method of the class: Curl{}

No Hooks.

Return

resource|\CurlHandle. Subrequest's cURL handle

Usage

$Curl = new Curl();
$Curl->&get_subrequest_handle( $url, $headers, $data, $options );
$url(string) (required)
URL to request
$headers(array) (required)
Associative array of request headers
$data(string|array) (required)
Data to send either as the POST body, or as parameters in the URL for a GET/HEAD
$options(array) (required)
Request options, see {@see \WpOrg\Requests\Requests::response()} for documentation

Curl::get_subrequest_handle() code WP 6.7.1

public function &get_subrequest_handle($url, $headers, $data, $options) {
	$this->setup_handle($url, $headers, $data, $options);

	if ($options['filename'] !== false) {
		$this->stream_handle = fopen($options['filename'], 'wb');
	}

	$this->response_data       = '';
	$this->response_bytes      = 0;
	$this->response_byte_limit = false;
	if ($options['max_bytes'] !== false) {
		$this->response_byte_limit = $options['max_bytes'];
	}

	$this->hooks = $options['hooks'];

	return $this->handle;
}