WordPress at a glance
function is not described

WP_HTTP_Requests_Response::get_headers() public WP 4.6.0

Retrieves headers associated with the response.

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

No Hooks.

Return

\Requests_Utility_CaseInsensitiveDictionary. Map of header name to header value.

Usage

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

Changelog

Since 4.6.0 Introduced.

Code of WP_HTTP_Requests_Response::get_headers() WP 5.7.2

<?php
public function get_headers() {
	// Ensure headers remain case-insensitive.
	$converted = new Requests_Utility_CaseInsensitiveDictionary();

	foreach ( $this->response->headers->getAll() as $key => $value ) {
		if ( count( $value ) === 1 ) {
			$converted[ $key ] = $value[0];
		} else {
			$converted[ $key ] = $value;
		}
	}

	return $converted;
}