Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77977 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 44192 invoked from network); 14 Oct 2014 13:09:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Oct 2014 13:09:44 -0000 Authentication-Results: pb1.pair.com header.from=ben@benramsey.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=ben@benramsey.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain benramsey.com from 209.85.216.175 cause and error) X-PHP-List-Original-Sender: ben@benramsey.com X-Host-Fingerprint: 209.85.216.175 mail-qc0-f175.google.com Received: from [209.85.216.175] ([209.85.216.175:38301] helo=mail-qc0-f175.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C7/53-26074-8902D345 for ; Tue, 14 Oct 2014 09:09:44 -0400 Received: by mail-qc0-f175.google.com with SMTP id b13so248132qcw.20 for ; Tue, 14 Oct 2014 06:09:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=IieURLrYLf/VkCVCpheWTImWW7aPY6ln4LWASNm2cXU=; b=lVeApCZKhDaWtbkYW3p68SJCc4c5qsAcIThCDIGUEzL/+CRBtsab36TynqJOYvZA75 sDGW2ISGCyntKqrSj1Iwily7XzRlrH60z60EeYKVqDK8FIwMx6X7ASMc2RxNdUF0f3fC jmsG87dPurKcIdAShUIzQhnpZS/yChSioWSmJu0iKU6z/mLN486UQ4Exxr3fw80yLO1R uIQoji2ChjsPmwDGUN98MhYIiGzPopomwJRmrtqsQQEN7oYxsWb9TarsopMNqcedT8cG TbcQfjxkpryLaCmmi62K4DriMDrfQVaXZWqxLp+8CyfEGKrRBknZ4L+lHVf+jG1CL5D6 b4Gg== X-Gm-Message-State: ALoCoQnJjK88li0XZ2xA1zGo1wA3p5rth3G161MSJm+XLkK8Qc2QKmBnSMZiVL2UlgKuKA2x7KPM X-Received: by 10.224.7.7 with SMTP id b7mr8892644qab.87.1413292181285; Tue, 14 Oct 2014 06:09:41 -0700 (PDT) Received: from [10.0.0.70] (c-68-52-228-18.hsd1.tn.comcast.net. [68.52.228.18]) by mx.google.com with ESMTPSA id b59sm5034561qga.45.2014.10.14.06.09.40 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 14 Oct 2014 06:09:40 -0700 (PDT) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) In-Reply-To: Date: Tue, 14 Oct 2014 08:09:41 -0500 Cc: PHP internals list Content-Transfer-Encoding: quoted-printable Message-ID: <9CAD580B-48C1-4D91-B761-20F8A9804A66@benramsey.com> References: To: Kris Craig X-Mailer: Apple Mail (2.1878.6) Subject: Re: [PHP-DEV] New globals for PUT and DELETE From: ben@benramsey.com (Ben Ramsey) On Oct 14, 2014, at 7:47 AM, Kris Craig wrote: > Hey guys, >=20 > 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. >=20 > Is there a reason why we don't want this or is it just that nobody has > actually written it yet? >=20 > =97Kris This is due to the history of HTML forms sending POST requests with the = Content-Type application/x-www-form-urlencoded. That is, all the fields = are key/value pairs and may be easily converted into a PHP array. If you = use POST with application/json, nothing appears in $_POST, for example. In practice, we could support $_PUT and $_DELETE for requests that use = application/x-www-form-urlencoded, but most folks implementing PUT and = DELETE do not use application/x-www-form-urlencoded for these requests. I would venture to say that most people implementing PUT requests accept = application/json and most DELETE requests have no body at all. So, $_PUT = and $_DELETE superglobals wouldn=92t make sense. -Ben