php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #17545 getallheaders - changed to return text of headers
Submitted: 2002-05-31 12:49 UTC Modified: 2017-10-23 00:36 UTC
Votes:8
Avg. Score:2.9 ± 1.3
Reproduced:2 of 6 (33.3%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: php at it-solutions dot org Assigned: kalle (profile)
Status: Closed Package: HTTP related
PHP Version: * OS:
Private report: No CVE-ID: None
 [2002-05-31 12:49 UTC] php at it-solutions dot org
Firstly I love PHP,
Secondly there isn't much it can't do that I want to do
But...

It would be nice if it could do everything that ASP can do (or everything that is possible - given that it shouldn't have to do Microsoft BS)

In particular in ASP you can get the Raw request header (using a function called Request.BinaryRead) 

I have not been able to find a way of doing this in PHP. Indeed I got quite hopeful when I found the getallheaders function - but this turned out to return another associative array. 

Please can we have just the raw text - for cases when poorly written responders don't output correctly.

Thanks again

Ben

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-06-01 02:17 UTC] edink@php.net
What exactly cannot be accomplished with getallheaders() as it is now? 
 [2002-06-01 10:36 UTC] php at it-solutions dot org
Ok - as I understand it - getallheaders returns the headers in an associative array - however if the headers are not formed properly (such as those where a return type is not specified) it isn't always possible to break them down into an array. It would be nice to be able to retrieve the headers in a 'raw' format so that the programmer could then parse and analyze them himself.

Ben
 [2002-06-01 10:42 UTC] rasmus@php.net
This is web-server dependant, and at least with Apache there is no clean way to get this information.
 [2010-12-01 16:14 UTC] jani@php.net
-Package: Feature/Change Request +Package: HTTP related -Operating System: Er - Does it matter? +Operating System: -PHP Version: 4.0CVS-2002-05-31 +PHP Version: *
 [2017-10-23 00:36 UTC] kalle@php.net
-Status: Analyzed +Status: Closed -Assigned To: +Assigned To: kalle
 [2017-10-23 00:36 UTC] kalle@php.net
Like Rasmus noted some ages ago, there is no clean way to provide this information, however if a patch comes up that can unify this, I'm sure it can find its way to the core
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 14:01:32 2024 UTC