Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108535 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 11748 invoked from network); 13 Feb 2020 13:08:59 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 13 Feb 2020 13:08:59 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 01F891804D7 for ; Thu, 13 Feb 2020 03:23:23 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.5 required=5.0 tests=BAYES_20,FROM_SUSPICIOUS_NTLD, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS22612 198.54.127.0/24 X-Spam-Virus: No X-Envelope-From: Received: from MTA-08-3.privateemail.com (mta-08-3.privateemail.com [198.54.127.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 13 Feb 2020 03:23:22 -0800 (PST) Received: from MTA-08.privateemail.com (localhost [127.0.0.1]) by MTA-08.privateemail.com (Postfix) with ESMTP id BD5736003E; Thu, 13 Feb 2020 06:23:20 -0500 (EST) Received: from APP-06 (unknown [10.20.147.156]) by MTA-08.privateemail.com (Postfix) with ESMTPA id 967B660033; Thu, 13 Feb 2020 11:23:20 +0000 (UTC) Date: Thu, 13 Feb 2020 14:23:20 +0300 (EET) Reply-To: "Ekin B." To: =?UTF-8?Q?C=C3=B4me_Chilliet?= , internals@lists.php.net Message-ID: <876634340.168763.1581593000586@privateemail.com> In-Reply-To: <5904137.fSVIMsojiJ@mcmic-probook> References: <50BD013E-CF72-414C-BBC0-A7A2E45CBDDB@pmjones.io> <5904137.fSVIMsojiJ@mcmic-probook> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Priority: 3 Importance: Normal X-Mailer: Open-Xchange Mailer v7.10.2-Rev20 X-Originating-Client: open-xchange-appsuite X-Virus-Scanned: ClamAV using ClamSMTP Subject: Re: [PHP-DEV] RFC: Server-Side Request and Response Objects (v2) From: me@ekins.space ("Ekin B.") Hi all, > On February 13, 2020 1:52 PM C=C3=B4me Chilliet wrote: >=20 > =20 > Le mercredi 12 f=C3=A9vrier 2020, 19:20:56 CET Niklas Keller a =C3=A9crit= : > > Naming > >=20 > > I think we shouldn't take over the naming of the super globals, e.g. > > $_GET really contains the query parameters and has nothing to do with > > GET or POST, so $request->getQueryParameter(...) would be a better > > name. >=20 > I think this remark is really on point. > GET and POST are HTTP methods and not ways of passing data. You can have = query parameters on any request, and you can have POST data with a lot of o= ther HTTP methods, as is commonly used in REST APIs. >=20 > I do not like the name getQueryParameter at first sight, but I do not lik= e get() and post() for getting values from $_GET and $_POST. > I would expect a method named post to actually post something, not just g= et a value. >=20 > --=20 > C=C3=B4me Chilliet > FusionDirectory - https://www.fusiondirectory.org >=20 > -- I agree that this is indeed on point. Personally I would like $request->getQueryParameter() and $request->getBody= () over $request->get() and $request->post(). In the former case you are asking for the parameters in the query string (q= uery component of the URI) and the latter is to get the request body. These= method names make it very clear what you're asking for. What kind of bothers me in general about this RFC is that... we are talking= about Request and Response and these are standard HTTP components, yet the= RFC is about providing wrappers for existing global PHP variables and func= tions. It does not try to model these components as they are in their stand= ard, nor aim to do so. This is why I believe it's better to leave it to userland implementations. = Besides the fact that they are widely adopted, they attempt to follow the s= pecification they are providing.=20 Regards, Ekin H. Bayar=20 https://ekins.space=20 https://heap.space