WordPress at a glance
function is not described

WP_HTTP_Requests_Response::to_array() public WP 4.6.0

Converts the object to a WP_Http response array.

{} It's a method of the class: WP_HTTP_Requests_Response{}

No Hooks.

Return

Array. WP_Http response array, per WP_Http::request().

Usage

$WP_HTTP_Requests_Response = new WP_HTTP_Requests_Response();
$WP_HTTP_Requests_Response->to_array();

Changelog

Since 4.6.0 Introduced.

Code of WP_HTTP_Requests_Response::to_array() WP 5.7.2

<?php
public function to_array() {
	return array(
		'headers'  => $this->get_headers(),
		'body'     => $this->get_data(),
		'response' => array(
			'code'    => $this->get_status(),
			'message' => get_status_header_desc( $this->get_status() ),
		),
		'cookies'  => $this->get_cookies(),
		'filename' => $this->filename,
	);
}