WP_Http::processResponse( string $strResponse )

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


Description Description


Parameters Parameters

$strResponse

(string) (Required) The full response string


Top ↑

Return Return

(array) Array with 'headers' and 'body' keys.


Top ↑

Source Source

File: wp-includes/class-http.php

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

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

Top ↑

Changelog Changelog

Changelog
Version Description
2.7.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

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