Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:69318 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 8536 invoked from network); 24 Sep 2013 14:59:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Sep 2013 14:59:23 -0000 Authentication-Results: pb1.pair.com smtp.mail=rdlowrey@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rdlowrey@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.173 as permitted sender) X-PHP-List-Original-Sender: rdlowrey@gmail.com X-Host-Fingerprint: 209.85.215.173 mail-ea0-f173.google.com Received: from [209.85.215.173] ([209.85.215.173:65169] helo=mail-ea0-f173.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 18/31-01825-AC8A1425 for ; Tue, 24 Sep 2013 10:59:23 -0400 Received: by mail-ea0-f173.google.com with SMTP id g10so2537937eak.18 for ; Tue, 24 Sep 2013 07:59:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=DpLk0ltJPGDfEx+k5T1P9SJMNpbQvHJI27PW2YraIT0=; b=UMoretmx/5PJC4cyEngOfF925Yn9FpU1w0LmkRa5hJP57r3I1PJZ6w0uovhmcJLOYM R1NvhmYWCw3DxOXCsCTKQrWU5tj8PmUsCU/DtjC+sls6Dx9xBxpxV2a8JsK+6WogaAog WeKiSh5vr0U1B/IQx8ulyWdL9hwY9y19yypAkw3w4H5fgClGwd4TWOpH8Zln4HPE9cH0 GgqbT6kEZQ7A404kxUfvlfosweVI8IYeo8oUW4brNOPepcIGpswT8rGcrhkh8+jIdV+h 9W2ppe1IJky17S8D5TY0aXu/nB0slDhgvIIVWsjILdSGI8CRQSz0xNidQcb81wvQAU6v 3xkA== MIME-Version: 1.0 X-Received: by 10.14.104.199 with SMTP id i47mr3179930eeg.85.1380034759299; Tue, 24 Sep 2013 07:59:19 -0700 (PDT) Received: by 10.223.199.129 with HTTP; Tue, 24 Sep 2013 07:59:19 -0700 (PDT) Date: Tue, 24 Sep 2013 10:59:19 -0400 Message-ID: To: "internals@lists.php.net" , Ryan McCue , Tjerk Meesters , catch.dave@gmail.com Content-Type: multipart/alternative; boundary=001a11c275da9b368604e72261ca Subject: Re: Parsing PUT data From: rdlowrey@gmail.com (Daniel Lowrey) --001a11c275da9b368604e72261ca Content-Type: text/plain; charset=ISO-8859-1 > In short, in order to provide a proper REST service that supports multipart > form data, we need someway to parse data sent via PUT (data is available > via php://input, but it needs to be parsed). Multipart entity parsing is fairly straightforward. You could easily write a parser in userland to accomplish the same thing. Unless you're doing a very high volume of CRUD via PUT the performance hit of doing this in userland should be negligible. That said, I think exposing a function to do this could be a useful addition, and since PHP already has code to parse these entities for POST requests it shouldn't be too much work to expose that via something like a new mime_multipart_parse() function. It's not really a priority for me, but you can probably find someone to work on this for you if you're not a C person. The bigger issue here is that the superglobals are a leaky abstraction. Any HTTP request method is allowed to have an entity body, so should we also create $_PATCH and $_PUT and $_ZANZIBAR to handle less-frequently used request methods? Where does it stop? This is the problem I see with all the requests to support for PUT similarly to POST. PHP web SAPIs support 95% of the HTTP use-cases people have, but the abstractions break down after that and continuously bolting on support for individual scenarios beyond that would be a mistake IMO. --001a11c275da9b368604e72261ca--