Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:97391 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 18477 invoked from network); 13 Dec 2016 19:26:02 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Dec 2016 19:26:02 -0000 Authentication-Results: pb1.pair.com smtp.mail=mike.php.net@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=mike.php.net@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.173 as permitted sender) X-PHP-List-Original-Sender: mike.php.net@gmail.com X-Host-Fingerprint: 209.85.220.173 mail-qk0-f173.google.com Received: from [209.85.220.173] ([209.85.220.173:34377] helo=mail-qk0-f173.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7D/14-21185-74B40585 for ; Tue, 13 Dec 2016 14:26:01 -0500 Received: by mail-qk0-f173.google.com with SMTP id q130so127084076qke.1 for ; Tue, 13 Dec 2016 11:25:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=wnHGwXeoTYzQZtq26FXs2uIo2LjdLw3jc0zI/Q4p4AY=; b=U0aoAHBAx4ZNykl99ET5Ee65zRRQPXPPyxeQj5WXoc3a2FWUHBKTOTP3EAoTrAo+a+ RuU5btwXaLuZ1lHzjNWJ6EknDsW5F0LH2P8jDqaoWb6lFvZnTaTExGTFXjpg/yPfVoN9 MF9bIdu57GJMzT5DSsDhjK9reJ3J7FZU5WHoAutnz/1kK0z5M6rrYZcdG43evyAV2TEO RNqHrZvWPhhZ5tp/JcQ/SeWPUHUAN5c+4pbQKIoUgD+LlhjiHM3M6Bgv6lzTYqV7DaC1 Kbiu+t2jTqyhK1l80lq6H93g/Vx+0jzizFV9YYQo32YumrUwCNTBBd2wKQ8imwekPMy9 AlhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=wnHGwXeoTYzQZtq26FXs2uIo2LjdLw3jc0zI/Q4p4AY=; b=aYpGgnxnP1IOa6fWDWzmu5T97YDygonnEgIIYM+qx4lBFQW7ulZ1gvkwZfv4L9O9Sx 7GqDMYKW9huRbEWKPdfd76Yt6xAz4zV+GtZ3PHZU2qAeWKb3XiM3n5i1a6Nb8yS2qgnD LQx7192a3xzFAr3RatlUtG5O8Kn2ARK3UyuT98LGGs/Lg2JbuSHnB5v62XCT+eW6spVv zRJRoDoCUDU3MJh+NfANR2La2wjhjLHNpWfrWvPEOBZN3HpOsPMxtKh+I90wngAovwvz pCLD2WluxKsLRl1/2aBTrZ9gwzXbm8LNHYNkwujJY2rpVOcz/brkzRq0l3VCz/kA2Rqz zZNw== X-Gm-Message-State: AKaTC011Y+W/ud8RD6nicasd0OS3iwoHhnAHP/zTI+LMqZiOGXbw5AUQYIzFmodVvFqGAkPsiqE1M1/3zvZzng== X-Received: by 10.55.149.131 with SMTP id x125mr85170682qkd.128.1481657155919; Tue, 13 Dec 2016 11:25:55 -0800 (PST) MIME-Version: 1.0 Received: by 10.237.59.117 with HTTP; Tue, 13 Dec 2016 11:25:55 -0800 (PST) Received: by 10.237.59.117 with HTTP; Tue, 13 Dec 2016 11:25:55 -0800 (PST) In-Reply-To: References: Date: Tue, 13 Dec 2016 20:25:55 +0100 Message-ID: To: =?UTF-8?B?RGVqYW4gU3RvxaFpxIc=?= Cc: PHP Internals Content-Type: multipart/alternative; boundary=94eb2c084fca75263905438f30fe Subject: Re: [PHP-DEV] [RFC Proposal] Introducing New Global Variable to Support Other HTTP Methods and Content Types From: mike.php.net@gmail.com (Michael Wallner) --94eb2c084fca75263905438f30fe Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Am 13.12.2016 14:45 schrieb "Dejan Sto=C5=A1i=C4=87" : *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). Additionally it will parse the data only for *application/x-www-form-urlencoded* or *multipart/form-data *HTTP Content types. There are other 3rd party libraries and packages that enhance this and enable parsing for other request methods and content types, but i feel like this should have native support at this point. *Goal* Ideally, PHP should natively parse the incoming HTTP request body for all request methods, not only for GET and POST. I guess that completely replacing the $_POST and $_GET is out of the question as it would lead to no backward compatibility. Maybe an additional superglobal could be introduced ($_DATA)? Have a look at http://pecl.php.net/apfd which triggers the request body parser on any request method. Also, http://pecl.php.net/json_post provides a content type handler for JSON. Parsing of the request body happens before entering userland, so providing a pluggable interface (to userland) is not an option currently. Cheers, Mike Thanks --94eb2c084fca75263905438f30fe--