Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:97387 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 4654 invoked from network); 13 Dec 2016 15:49:21 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Dec 2016 15:49:21 -0000 Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.210.196 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 209.85.210.196 mail-wj0-f196.google.com Received: from [209.85.210.196] ([209.85.210.196:35850] helo=mail-wj0-f196.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B3/22-21185-08810585 for ; Tue, 13 Dec 2016 10:49:21 -0500 Received: by mail-wj0-f196.google.com with SMTP id j10so17120722wjb.3 for ; Tue, 13 Dec 2016 07:49:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=user-agent:in-reply-to:references:mime-version :content-transfer-encoding:subject:from:date:to:message-id; bh=vIujDCFwEFypEmtVHPE8LAeWK/iwstS7qu/nTxZU9Is=; b=TW0ofIIWGW1WYoZOlvBPa39k+hB4f9JbE9P7TeW9YoVkobYCU8613cM2BljQfXU5sE 6odO6k/T+W6Hpjab37adTfmCJ2fkkX946Kv6yuHJBFBbzsJ0HOinNorulP6CXAD9FXHD CsFCzrBW8zlrW7zVTuykD6+hlpR8xzfzFFfihOmSzpPVVbaw81nxe51wiz18LZyRDNTT NgfLeHogKwBrW+6Opc5q1BEhz95Nz5B10HFCfbYDikuPv7+Fec0t6JfvoIl2ZMsihLnv vS6G5xDioIDhVw5kwv1TCLLIzXOCBemPufA+rFwCk9qyETQWq/8IraUTKN8OkGgxYm2O drAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:user-agent:in-reply-to:references:mime-version :content-transfer-encoding:subject:from:date:to:message-id; bh=vIujDCFwEFypEmtVHPE8LAeWK/iwstS7qu/nTxZU9Is=; b=CnVGXkOOLeDKmicdg831S6wHSxFALVzwkcMTrk5IZ3Y/rX51itmrUlyYKMv4yPZGgX mB/XHV19d2yj3ozUpnT8W+QvcMcIe7deX5KinddF8toY07LqCZPGoEYe4FlNmV2ENqCw YA33V3/kFyuHjZq4YEez0EJh1LQwibq0nGgeDtmUPcaeKsQcslhrh0PqQNtvKr3k4uII ziD4BNbheCYRStlqZ9eXRFTf7KQwR51Z4B57HteoKMoWKEpBcTzzWgygC44gAfv0e8x7 nGi352dlOz8HjyixDIw5Pe2CQwVAzYnaAdwmnkNcH10lDu6brardrS9cX9sVJwICdLM1 /WNA== X-Gm-Message-State: AKaTC02ZP6BBh4tTekS9LW2fPc1QHtl3AY4qECPyjaunrG2NEpYROS4GQso3q3pXLh7HmQ== X-Received: by 10.194.205.225 with SMTP id lj1mr97176292wjc.122.1481644157210; Tue, 13 Dec 2016 07:49:17 -0800 (PST) Received: from broadband.bt.com ([2a00:23c4:4bd2:6e00:8060:843e:ad95:20ed]) by smtp.gmail.com with ESMTPSA id u81sm3189428wmu.10.2016.12.13.07.49.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Dec 2016 07:49:16 -0800 (PST) User-Agent: K-9 Mail for Android In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Date: Tue, 13 Dec 2016 15:49:14 +0000 To: =?UTF-8?Q?Dejan_Sto=C5=A1i=C4=87?= ,internals@lists.php.net Message-ID: Subject: Re: [PHP-DEV] [RFC Proposal] Introducing New Global Variable to Support Other HTTP Methods and Content Types From: rowan.collins@gmail.com (Rowan Collins) On 13 December 2016 13:38:53 GMT+00:00, "Dejan Stošić" wrote: >*Disclaimer* >Sorry if this has been discussed before, i tried searching, but i >couldn't >find much information. It has, quite often actually. Here's a few threads I found in a quick search that look relevant: https://marc.info/?t=138003492500001&r=1&w=2 https://marc.info/?t=141329101900006&r=1&w=2 https://marc.info/?t=144226586800002&r=1&w=2 https://marc.info/?t=140822909300001&r=1&w=2 https://marc.info/?t=138069733000002&r=1&w=2 https://marc.info/?t=134822559800006&r=1&w=2 >*The problem* >Currently, PHP will parse the incoming HTTP request body only for GET >requests (and store the data in superglobal $_GET) and for POST >requests >(and store the data in $_POST). This isn't actually true. Despite the names, $_GET and $_POST don't actually have anything to do with the HTTP request verb. One tokenises the URL's "query string", and the other the request body. For a GET request, there is no body to parse, but for a POST request, it's perfectly normal for both to be populated. >Additionally it will parse the data only for >*application/x-www-form-urlencoded* or *multipart/form-data *HTTP >Content >types. This much is true, but as you'll see from previous discussions, it's not entirely clear how to usefully extend it. If we hard code the rules (e.g. the options json_decode offers) we limit people's options. If we give a pluggable interface, people might as well just parse the raw input themselves. Basically, you're not the first to think "some kind of support" is needed, but as yet nobody has come up with a compelling description of just what that support should look like. However, don't let that discourage you. If you do a bit more digging into the archives to understand the challenges, maybe you can come up with a new take on the idea. Regards, -- Rowan Collins [IMSoP]