WordPress at a glance

wp_remote_retrieve_body() WP 1.0

Retrieve only the body from the raw response.

No Hooks.


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


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


Since 2.7.0 Introduced.

Code of wp_remote_retrieve_body() WP 5.7.2

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

	return $response['body'];

From tag: HTTP API (curl remote)

No comments
    Log In