GC_HTTP_Requests_Response::to_array()

最后更新于:2021-12-01 11:11:22

GC_()

Converts the object to a GC_Http response array.

响应

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

源文件

文件: gc-includes/class-gc-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,
		);
	}