Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78071 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 1306 invoked from network); 14 Oct 2014 21:44:06 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Oct 2014 21:44:06 -0000 Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.179 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 209.85.212.179 mail-wi0-f179.google.com Received: from [209.85.212.179] ([209.85.212.179:45011] helo=mail-wi0-f179.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 70/78-18603-5299D345 for ; Tue, 14 Oct 2014 17:44:05 -0400 Received: by mail-wi0-f179.google.com with SMTP id d1so294097wiv.6 for ; Tue, 14 Oct 2014 14:44:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=EMGbVHFGSJhb5v1yLkMgCc4B/pakkiQDBDP2HfXRv8M=; b=IejXyXUdRgU7SZAveVgpLiQOSmRkBvGYGG0bV5QUynFTXkoKGcNUhucOHgPP5KX19t QS+U940S4pnipSlE/z5IVBlbFVRRljLQRdrH/usgS+nngaVzeArGPvAREkU49vwsMPVg VQDk7TN+zi2lK9s071u+J9V1ERN+bXfbTeKuUhjBiXVUHfrhdanZwJr7G3Zm0fBSOSiQ KfdNWK9u1spb4k6XLXoPhfsKjhFdS9kumkUfaVEbGSqnpwbOjIqHGJdLFH/lpYLAerZO PgFlKMFMR+ArAOWCNO5iFJMT7qP/nuioosM83Le7syPv4FnOImMO2O+rmz5bhoUt0IiJ cgLw== X-Received: by 10.180.77.229 with SMTP id v5mr7741950wiw.59.1413323042200; Tue, 14 Oct 2014 14:44:02 -0700 (PDT) Received: from [192.168.0.2] (cpc68956-brig15-2-0-cust215.3-3.cable.virginm.net. [82.6.24.216]) by mx.google.com with ESMTPSA id mc4sm17092685wic.6.2014.10.14.14.44.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 14 Oct 2014 14:44:01 -0700 (PDT) Message-ID: <543D991E.7040405@gmail.com> Date: Tue, 14 Oct 2014 22:43:58 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: internals@lists.php.net References: <776669CE-9E8C-4069-9834-C7275CCA0EF4@ajf.me> <8CB055D4-F164-4DF3-B019-684BAE7E016E@ajf.me> <543D47C1.9050009@lerdorf.com> <543D4CE1.5000109@lerdorf.com> <543D6864.10508@gmail.com> <543D85E6.2020507@lerdorf.com> In-Reply-To: <543D85E6.2020507@lerdorf.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] New globals for PUT and DELETE From: rowan.collins@gmail.com (Rowan Collins) On 14/10/2014 21:21, Rasmus Lerdorf wrote: > On 10/14/2014 11:16 AM, Rowan Collins wrote: >> On 14/10/2014 17:18, Rasmus Lerdorf wrote: >>> I think 20+ years of history has proven this to be a non-issue. Of all >>> the things that people get confused by in PHP, $_GET/$_POST are right >>> near the bottom of the list. >> The popularity of REST is what has changed this. Until people started >> writing RESTful APIs, only two HTTP request types were in common use. >> Nobody was confused about where PUT method data would end up, because >> nobody processed any PUT methods. >> >>> It makes no sense to me to make $_BODY an alias for $_POST. $_POST >>> implies the default body encoding that a broswer performs on a POST >>> request. Making an alias called $_BODY that doesn't contain the body of >>> a request unless it is "POST"-encoded would be super confusing. >> The encoding has no relationship with the request type, even in browsers >> - the default encoding of a POST form is actually the same encoding used >> to produce a URL form a GET form. > Sure, but $_GET/$_POST do. They were not named to match HTTP primitives. > They were named to match form methods. As in form method="get" and > method="post". And here the default encoding the browsers use for these > two methods definitely matter. Like, I say, application/x-www-form-urlencoded is the default encoding for both method="get" and method="post". The difference is that one executes an HTTP GET, and appends the encoded data to the request URL, while the other executes an HTTP POST, and encloses the encoded data as the request body. Even coming from a browser form, both $_GET and $_POST can be populated simultaneously, with independent data:
-- Rowan Collins [IMSoP]