Re: Re: HTTP supergloblas and request body/query (was: Parsing PUT data)

From: Date: Mon, 07 Oct 2013 15:50:35 +0000
Subject: Re: Re: HTTP supergloblas and request body/query (was: Parsing PUT data)
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-69507@lists.php.net to get a copy of this message
Daniel Lowrey wrote (on 02/10/2013):
Something like the following would be an infinitely superior solution: interface HttpRequest {
While having a quick look for userland parsing functions earlier, I came upon the PECL http extension, which includes this all-singing object: http://www.php.net/manual/en/class.httprequest.php As for this:
You can't efficiently model an HTTP request with associative arrays. Period.
The fact is that for 99% of use cases, yes you can, and developers happily do so. PHP even allows the convenient field_name[]= and field_name[key]= notations for building multi-dimensional arrays. This is all a convenience wrapper, and a consistent low-level API would be good, but alternative high-level APIs can be built from a few fundamental building blocks (e.g. getting the basic raw request parts as strings, parsing strings in various form encodings) without building a whole HTTP framework into the core. Regards, -- Rowan Collins [IMSoP]

« previous php.internals (#69507) next »