Re: [RFC] Add http_(get|clear)_last_request_headers() function
| From: | Aleksander Machniak | Date: | Wed, 03 Jan 2024 14:34:28 +0000 |
| Subject: | Re: [RFC] Add http_(get|clear)_last_request_headers() function | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-122098@lists.php.net to get a copy of this message | ||
On 3.01.2024 14:41, Gina P. Banyard wrote:
Link: https://wiki.php.net/rfc/http-last-response-headersWrong function name in the subject (should be "response" not "request") I don't think we need the clearing function. Do we? I don't like that this is HTTP specific feature while we have other protocol wrappers. Here's a different approach. Use stream context with extended context parameters feature. Something like: $context = stream_context_create(); $file = file_get_contents('http://www.example.com/', false, $context); $headers = stream_context_get_params($context)['response_headers']; Or something like that. I don't know. While on this I found out that we already have stream_get_meta_data() and
wrapper_data there. So, maybe we should/could make it more unified.
Maybe it should be mentioned in the RFC.
--
Aleksander Machniak
Kolab Groupware Developer [https://kolab.org]
Roundcube Webmail Developer [https://roundcube.net]
----------------------------------------------------
PGP: 19359DC1 # Blog: https://kolabian.wordpress.com