Retrieve only the body from the raw response.
<?php $body = wp_remote_retrieve_body($response); ?>
Retrieving data from a JSON API:
$url = 'http://example.org/api'; $response = wp_remote_get( esc_url_raw( $url ) ); /* Will result in $api_response being an array of data, parsed from the JSON response of the API listed above */ $api_response = json_decode( wp_remote_retrieve_body( $response ), true );
Since: 2.7.0
wp_remote_retrieve_body() is located in wp-includes/http.php