WP_Http::processResponse()public staticWP 2.7.0

Parses the responses and splits the parts into headers and body.

{} It's a method of the class: WP_Http{}

No Hooks.

Return

Array. Array with response headers and body.

Usage

$result = WP_Http::processResponse( $response ) // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid;
$response(string) (required)
The full response string.

Changelog

Since 2.7.0 Introduced.

Code of WP_Http::processResponse() WP 6.0

public static function processResponse( $response ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
	$response = explode( "\r\n\r\n", $response, 2 );

	return array(
		'headers' => $response[0],
		'body'    => isset( $response[1] ) ? $response[1] : '',
	);
}