On this page
WP_Http::processResponse( string $response ): array
Parses the responses and splits the parts into headers and body.
Parameters
$responsestring Required-
The full response string.
Return
array Array with response headers and body.
headersstringHTTP response headers.bodystringHTTP response body.
Source
File: wp-includes/class-wp-http.php. View all references
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] : '',
);
}
Related
Used By
| Used By | Description |
|---|---|
| WP_Http_Streams::request() wp-includes/class-wp-http-streams.php | Send a HTTP request to a URI using PHP Streams. |
Changelog
| Version | Description |
|---|---|
| 2.7.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_http/processresponse