Improvements to HTTP stream metadata

From: Date: Thu, 30 Jun 2011 20:44:05 +0000
Subject: Improvements to HTTP stream metadata
Groups: php.internals 
Request: Send a blank email to internals+get-53708@lists.php.net to get a copy of this message
Hi, Currently, if you open an HTTP stream using fopen(), and then call stream_get_meta_data() on it, you obtain an associative array within which as another with the key 'wrapper_data'. Inside that, there is a list of the HTTP headers from the server response. I'd like to make this a little more useful as currently I don't believe there's a way to get the response code from the remote end without parsing those headers yourself. While this isn't hard, I'd like to make the following changes: * move the current contents of the wrapper_data array to a key called 'headers' within wrapper_data; * Add a 'response_code' key, with the server response code as an integer * Optionally, add things like the mime type of the response. Anyone got any thoughts on this? I appreciate it'd be a BC break, but I think it might be useful. -- Cheers, Michael

« previous php.internals (#53708) next »