Re: [PHP-DEV] Native support - PUT request, multipart form data

[email protected] (Chris Wright)
Newsgroups php.internals
Message-ID <CAGAGxbYGfzZh+GTLF1QjfC8Bt27bCoWUiueJZhxHfwiG_zLXtQ@mail.gmail.com>
On 17 August 2014 00:47, Park Framework <[email protected]> wrote:
> Variable $_PUT is already a popular name.
> Many for yourself already so it was called, at the bottom link.
> http://stackoverflow.com/search?q=PHP+%24_PUT
>
> But I like the name $_DATA - it is universal for any request method.

IMO $_BODY would make more sense, $_DATA is very ambiguous.

> For frontend developers, this name is very clear:
> $.ajax({
>     type: "PUT",
>     contentType: "application/json",
>     data: {"name": "value"}
> });
>
> Except multipart form data, needed and native support for application/json.
>
> In many languages (Java, Python, ASP), it has long been there.
> It is a pity that the PHP in 2014, it has not yet implemented.

For the record, IMHO what is required here is a *bundled* OO request
abstraction extension, which would expose the underlying parser
routines in such a way that conversions of the input to a data
structure can be done with a single call. but *not* make any
assumptions about what is being done in the application. It has never
sat well with me that multipart inputs cannot be accessed as a raw
string.

I haven't actually given any though to what this API would look like though...
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.