Requests_Transport_cURL::process_response() public WP 1.0
Process a response
{} It's a method of the class: Requests_Transport_cURL{}
No Hooks.
Return
String. HTTP response data including headers
Usage
$Requests_Transport_cURL = new Requests_Transport_cURL(); $Requests_Transport_cURL->process_response( $response, $options );
- $response(string) (required)
- Response data from the body
- $options(array) (required)
- Request options
Code of Requests_Transport_cURL::process_response() Requests Transport cURL::process response WP 5.6.2
public function process_response($response, $options) {
if ($options['blocking'] === false) {
$fake_headers = '';
$options['hooks']->dispatch('curl.after_request', array(&$fake_headers));
return false;
}
if ($options['filename'] !== false) {
fclose($this->stream_handle);
$this->headers = trim($this->headers);
}
else {
$this->headers .= $response;
}
if (curl_errno($this->handle)) {
$error = sprintf(
'cURL error %s: %s',
curl_errno($this->handle),
curl_error($this->handle)
);
throw new Requests_Exception($error, 'curlerror', $this->handle);
}
$this->info = curl_getinfo($this->handle);
$options['hooks']->dispatch('curl.after_request', array(&$this->headers, &$this->info));
return $this->headers;
}