Re: New globals for PUT and DELETE

From: Date: Tue, 14 Oct 2014 20:21:58 +0000
Subject: Re: New globals for PUT and DELETE
References: 1 2 3 4 5 6 7 8 9 10 11  Groups: php.internals 
Request: Send a blank email to internals+get-78062@lists.php.net to get a copy of this message
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. -Rasmus

« previous php.internals (#78062) next »