wp_remote_retrieve_body( array|WP_Error $response )

Retrieve only the body from the raw response.


Description


Parameters

$response

(array|WP_Error) (Required) HTTP response.


Top ↑

Return

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


Top ↑

Source

File: wp-includes/http.php

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

	return $response['body'];
}

Top ↑

Changelog

Version Description
2.7.0 Introduced.