Uses
Uses | Description |
---|---|
wp-includes/Requests/Utility/CaseInsensitiveDictionary.php: Requests_Utility_CaseInsensitiveDictionary::__construct() | Creates a case insensitive dictionary. |
Retrieves headers associated with the response.
(Requests_Utility_CaseInsensitiveDictionary) Map of header name to header value.
File: wp-includes/class-wp-http-requests-response.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; }
Version | Description |
---|---|
4.6.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_http_requests_response/get_headers