Requests_Transport_cURL::get_subrequest_handle()
最后更新于:2021-11-26 04:06:18
Requests_Transport_cURL::get_subrequest_handle( string$url, array$headers, string|array$data, array$options)Get the cURL handle for use in a multi-request
参数
- $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 Requests::response() for documentation
响应
(resource) Subrequest’s cURL handle
源文件
文件: gc-includes/Requests/Transport/cURL.php
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;
}