WordPress at a glance
Home All Function Functions APIs HTTP API

wp_remote_retrieve_body() WP 1.0

Retrieve only the body from the raw response.

No Hooks.

Return

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

Usage

wp_remote_retrieve_body( $response );
$response(array) (required)
HTTP response.

Changelog

Since 2.7.0 Introduced.

Code of wp remote retrieve body: wp-includes/http.php WP 5.2.2

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

	return $response['body'];
}

Related Functions

From tag: HTTP API (curl remote)

No comments
    Hello, !     Log In . Register