WP_HTTP_Requests_Response::to_array

Advertisement

Summery Summery

Converts the object to a WP_Http response array.

Syntax Syntax

WP_HTTP_Requests_Response::to_array()

Return Return

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

Source Source

File: wp-includes/class-wp-http-requests-response.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,
		);
	}

Advertisement

Changelog Changelog

Changelog
Version Description
4.6.0 Introduced.

Advertisement

Leave a Reply