Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78779 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 64433 invoked from network); 6 Nov 2014 04:03:01 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Nov 2014 04:03:01 -0000 Authentication-Results: pb1.pair.com smtp.mail=theanomaly.is@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=theanomaly.is@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.181 as permitted sender) X-PHP-List-Original-Sender: theanomaly.is@gmail.com X-Host-Fingerprint: 209.85.212.181 mail-wi0-f181.google.com Received: from [209.85.212.181] ([209.85.212.181:37961] helo=mail-wi0-f181.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 53/D6-28384-3F2FA545 for ; Wed, 05 Nov 2014 23:03:00 -0500 Received: by mail-wi0-f181.google.com with SMTP id n3so296660wiv.14 for ; Wed, 05 Nov 2014 20:02:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=8+UdQ5OU1EJKOZ8w6pCsI3jyKZg3VuuEhThgyfRGIqg=; b=fTN5V/r+SCDYtb5wabDRJl3HYTMvA7u8XLkhusagk4QsnBXp2Aej0VDlY6WN+d5+f9 jfneVmDbooEybQODfLsKGF8tj9nGTeWcATtzU5YLF73iSP7IqHsU0jC92KNdUcprcg0m KiqyoK2InUckLzS3CvblcPru1z2HZxrlmkh1sEtlHMk/r4o8MD/0pRrO25MNIO+z0CsB EUXjDTrlyxK85iHbhyfX52Q1yunDA1KEbbIxHPVdKpZSX/wWT6QBdk/XJWqwBqcOMi+O YdRHu6mP0Dv/i3YTemaIT5Fj6sFtWhsZzq+cZroVLXGo4m0shCHJs1A3AAP43eURkiFY xfgw== MIME-Version: 1.0 X-Received: by 10.180.14.165 with SMTP id q5mr3031253wic.0.1415246576395; Wed, 05 Nov 2014 20:02:56 -0800 (PST) Received: by 10.216.123.4 with HTTP; Wed, 5 Nov 2014 20:02:56 -0800 (PST) In-Reply-To: <9FB8B541-A040-4C0E-8884-A1EA06B3C266@php.net> References: <1DDB6E05-3143-4A74-8B13-AF85222579BA@ajf.me> <468730E8-4C38-49A3-A61A-59E107313D79@ajf.me> <9FB8B541-A040-4C0E-8884-A1EA06B3C266@php.net> Date: Wed, 5 Nov 2014 23:02:56 -0500 Message-ID: To: Will Fitch Cc: Andrea Faulds , Patrick ALLAERT , PHP Internals Content-Type: multipart/alternative; boundary=f46d04138ae374aaff050728c537 Subject: Re: [PHP-DEV] New Standardized HTTP Interface From: theanomaly.is@gmail.com (Sherif Ramadan) --f46d04138ae374aaff050728c537 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Wed, Nov 5, 2014 at 10:53 PM, Will Fitch wrote: > > > On Nov 5, 2014, at 10:00 PM, Sherif Ramadan > wrote: > > > > > > > > On Wed, Nov 5, 2014 at 9:36 PM, Will Fitch wrote: > > > > > > > > Easy - you have no idea what the input type is from PUT without checkin= g > the incoming type. With POST, you know exactly what it is. PUT input cod= e > be JSON, multipart mime, a file or a whatever the dev wants. > > > > > > That's not necessarily true. There are many APIs that will send POST > requests with a JSON payload in the request body. This is specifically wh= y > PHP won't bother parsing the request entity body unless the content-type > header is form ulr-encoded. Additionally you have to take > Content-encoding[1] into consideration as HTTP doesn't require that the > body of a POST request be url-encoded, just that the client specifies the > content-encoding and content-type[2][3] for entity decoding and then it > becomes up to the server how to handle or even accept the entity. > > I think a simple quote from RFC 2616 is necessary: > > "The fundamental difference between the POST and PUT requests is reflecte= d > in the different meaning of the Request-URI. The URI in a POST request > identifies the resource that will handle the enclosed entity. That resour= ce > might be a data-accepting process, a gateway to some other protocol, or a > separate entity that accepts annotations. In contrast, the URI in a PUT > request identifies the entity enclosed with the request -- the user agent > knows what URI is intended and the server MUST NOT attempt to apply the > request to some other resource. If the server desires that the request be > applied to a different URI, > it MUST send a 301 (Moved Permanently) response; the user agent MAY then > make its own decision regarding whether or not to redirect the request." > > (http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html) > > There is nothing relevant to data transformation between PUT and POST. It > is, for all intents and purposes, two completely different methods and yo= u > should not assume one is similar to the other - especially based solely o= n > what you want PUT to do. PUT can contain query strings, POST-like bodies > and files or a combination of any. > Correct, the HTTP request verb is about describing the intent of the request, which is what I said earlier. It is not about how to treat the enclosed entity body. For that the specification describes additional headers such as that of Content-type header. Nowhere did I suggest that the request verbs themselves (i.e. PUT and POST) have the same intent. Just that the handling of multipart-form data is not specific to either one of those verbs. > > Bottom line - you=E2=80=99re trying to change PHP=E2=80=99s form handling= approach with > your view of what PUT could/should be doing. Don=E2=80=99t do that. > I'm trying to take advantage of the fact that PHP can parse the multipart data regardless of the request verb. This is a good thing. It has added benefits. I see no reason why this would be a negative impact on PHP. If anything it makes PHP more useful in dealing with additional request types without the user having to parse the input stream themselves. > > It=E2=80=99s blowing my mind that you are still arguing this point, and I= believe > it=E2=80=99s time to put it to bed. Come up with a better solution, put = this RFC > to a vote (even without a patch) or retract it. You have have almost > nothing but criticism, and this thread is at the point of wasting valuabl= e > time. > > I'm sorry you feel that there is a waste of valuable time in this thread. By all means, if you feel that this thread is a waste of your time please disregard it. I have no intention of putting anything to a vote until I feel it is ready. Since it is currently a draft I feel no obligation to retract it. I do appreciate your time and input, however. --f46d04138ae374aaff050728c537--