Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77976 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 43576 invoked from network); 14 Oct 2014 13:09:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Oct 2014 13:09:22 -0000 Authentication-Results: pb1.pair.com header.from=kris.craig@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=kris.craig@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.218.47 as permitted sender) X-PHP-List-Original-Sender: kris.craig@gmail.com X-Host-Fingerprint: 209.85.218.47 mail-oi0-f47.google.com Received: from [209.85.218.47] ([209.85.218.47:64300] helo=mail-oi0-f47.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 48/33-26074-1802D345 for ; Tue, 14 Oct 2014 09:09:21 -0400 Received: by mail-oi0-f47.google.com with SMTP id a141so16606475oig.20 for ; Tue, 14 Oct 2014 06:09:18 -0700 (PDT) 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=0LPRlti/r7wn4QdLqTXIFeHHoL8nkqPyt/oEomxTHRU=; b=lb6eCBPTFkpgtiSIZfF4K8aO5CavTQ1vKWMty3cn99yUT1N7DTC84r4Q0pJUnZdyaD E10IQiTs3tXhDLq9h5B9fK1BNNFvVT2QfIdwwiQXndV38zwMGm6vB5C74zD50wmVqhm9 RX6d+WTLcgCFDKBKC5w8VN8EE+Ui9/PcvA6gEaGdibHTHxjAXSd7WjidpgabW5o5kE3t RfCR6LUT8GFPIEDI2I6lCp/nDMLCMBGw88SeO8tOAx9/RteXBWqvjNjhWQ/QlgOE7o5I sxIA9wsmiU2wQXJmpNB4kSt8j3RuwQmMUOcL3uS0L0aAE7WMAFwXrzxrgzGkN39dmVx6 4k3g== MIME-Version: 1.0 X-Received: by 10.182.234.35 with SMTP id ub3mr4430256obc.37.1413292158849; Tue, 14 Oct 2014 06:09:18 -0700 (PDT) Received: by 10.202.169.201 with HTTP; Tue, 14 Oct 2014 06:09:18 -0700 (PDT) In-Reply-To: <776669CE-9E8C-4069-9834-C7275CCA0EF4@ajf.me> References: <776669CE-9E8C-4069-9834-C7275CCA0EF4@ajf.me> Date: Tue, 14 Oct 2014 06:09:18 -0700 Message-ID: To: Andrea Faulds Cc: PHP internals list Content-Type: multipart/alternative; boundary=e89a8f838add17ad63050561b9bf Subject: Re: [PHP-DEV] New globals for PUT and DELETE From: kris.craig@gmail.com (Kris Craig) --e89a8f838add17ad63050561b9bf Content-Type: text/plain; charset=UTF-8 On Tue, Oct 14, 2014 at 5:54 AM, Andrea Faulds wrote: > > On 14 Oct 2014, at 13:47, Kris Craig wrote: > > > Hey guys, > > > > Does anybody know why we have $_GET and $_POST, but not $_PUT and > > $_DELETE? As far as I can tell, the only way to get these out currently > is > > to parse their values by reading the incoming stream directly. > > > > Is there a reason why we don't want this or is it just that nobody has > > actually written it yet? > > $_GET and $_POST are really misnomers. $_GET is query string parameters, > $_POST is request body data. > > We should just put the request bodies for all requests, not just POST, > into $_POST. > > -- > Andrea Faulds > http://ajf.me/ > > The problem with that approach though is that it would not be RESTful. I'm developing a REST API (with the goal of 100% REST compliance) and having PUT/DELETE variables mixed in with $_POST would not only be counter-intuitive, but it would just present a new roadblock. Incorporating GET in there, as well, would make things even worse. Basically, if we have $_GET and $_POST, then we should also have $_PUT and $_DELETE. Either that, or they should all be tossed. There's no reason why $_PUT and $_DELETE should not also exist. --Kris --e89a8f838add17ad63050561b9bf--