Requests::parse_multiple( string $response, array $request ): void

In this article

Callback for transport.internal.parse_response

Description

Internal use only. Converts a raw HTTP response to a \WpOrg\Requests\Response while still executing a multiple request.

$response is either set to a \WpOrg\Requests\Response instance, or a \WpOrg\Requests\Exception object

Parameters

$responsestringrequired
Full response text including headers and body (will be overwritten with Response instance)
$requestarrayrequired
Request data as passed into WpOrgRequestsRequests::request_multiple()

Return

void

Source

public static function parse_multiple(&$response, $request) {
	try {
		$url      = $request['url'];
		$headers  = $request['headers'];
		$data     = $request['data'];
		$options  = $request['options'];
		$response = self::parse_response($response, $url, $headers, $data, $options);
	} catch (Exception $e) {
		$response = $e;
	}
}

User Contributed Notes

You must log in before being able to contribute a note or feedback.