wordpress / latest / functions / wp_remote_retrieve_body.html

wp_remote_retrieve_body( array|WP_Error $response ): string

Retrieve only the body from the raw response.

Parameters

$response array|WP_Error Required
HTTP response.

Return

string The body of the response. Empty string if no body or incorrect parameter given.

Source

File: wp-includes/http.php. View all references

function wp_remote_retrieve_body( $response ) {
	if ( is_wp_error( $response ) || ! isset( $response['body'] ) ) {
		return '';
	}

	return $response['body'];
}

Uses

Uses Description

Used By

Used By Description

Changelog

Version Description
2.7.0 Introduced.

© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_remote_retrieve_body