Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78837 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 10974 invoked from network); 7 Nov 2014 05:23:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Nov 2014 05:23:32 -0000 Authentication-Results: pb1.pair.com smtp.mail=willfitch@php.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=willfitch@php.net; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 66.111.4.26 as permitted sender) X-PHP-List-Original-Sender: willfitch@php.net X-Host-Fingerprint: 66.111.4.26 out2-smtp.messagingengine.com Received: from [66.111.4.26] ([66.111.4.26:54516] helo=out2-smtp.messagingengine.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BA/03-24315-2575C545 for ; Fri, 07 Nov 2014 00:23:31 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 954C220745 for ; Fri, 7 Nov 2014 00:23:28 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute6.internal (MEProxy); Fri, 07 Nov 2014 00:23:28 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=x-sasl-enc:content-type:mime-version :subject:from:in-reply-to:date:cc:message-id:references:to; s= smtpout; bh=vW19VjBH26WjKxgv+fQQ6lEugAs=; b=CYaOjLqEW7GC0Oo8zoQ0 RaQCey9C9kKe83+iSCqH9fNz/81+1dRn9RmcTqREHYe/0MfNZJucDCi119a7yQN4 138EaDQzzqSMOCH6U+7p49C6RZHfdTegjvsew9YHyvd/99ojWKg6brKwEek+y/E9 GviUAVZE5fKShPid7I3pFOM= X-Sasl-enc: 9WivrQCf0nAVHpUjV5koE0SzOBnSsWQJmyrqDNsIaaSE 1415337808 Received: from wills-mbp.home (unknown [173.59.114.93]) by mail.messagingengine.com (Postfix) with ESMTPA id 33E4CC00008; Fri, 7 Nov 2014 00:23:28 -0500 (EST) Content-Type: multipart/alternative; boundary="Apple-Mail=_ADB48D24-C0A3-4EFD-8708-574E3FFFDE26" Mime-Version: 1.0 (Mac OS X Mail 8.0 \(1990.1\)) In-Reply-To: Date: Fri, 7 Nov 2014 00:23:28 -0500 Cc: Andrea Faulds , Stas Malyshev , Patrick ALLAERT , PHP Internals Message-ID: <00A54283-A64E-404A-AFF7-0D3DC5169C40@php.net> References: <1DDB6E05-3143-4A74-8B13-AF85222579BA@ajf.me> <468730E8-4C38-49A3-A61A-59E107313D79@ajf.me> <545C1823.8050404@sugarcrm.com> To: Sherif Ramadan X-Mailer: Apple Mail (2.1990.1) Subject: Re: [PHP-DEV] New Standardized HTTP Interface From: willfitch@php.net (Will Fitch) --Apple-Mail=_ADB48D24-C0A3-4EFD-8708-574E3FFFDE26 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Nov 7, 2014, at 12:16 AM, Sherif Ramadan = wrote: >=20 > On Thu, Nov 6, 2014 at 7:56 PM, Andrea Faulds > wrote: >=20 >>=20 >>> On 7 Nov 2014, at 00:53, Stas Malyshev = wrote: >>>=20 >>> Hi! >>>=20 >>>> Again, I think you're oversimplifying the problem. For one, you = don't >> know >>>> that the payload is JSON unless you check the Content-type header >> yourself, >>>> and you really shouldn't have to since PHP could easily do this for = you. >>>=20 >>> Sure, PHP could easily do this, or any other one specific use case = for >>> you. What it can't do, however, is to do all 1000 use cases that = modern >>> REST application presents, automatically for you. What if you use = XML >>> and not JSON? What if you use both and determine which one it is by >>> request URL suffix being .xml or .json? What if it instead is = switched >>> by query parameter? What if also it can be compressed, encrypted and >>> wrapped in some MIME multipart message? Having all these = complications >>> handled in the core of PHP would be extremely hard, not because each = of >>> them is hard, but because there can be so many of them. And you'd = run a >>> big change of PHP still not matching your specific case exactly, or >>> being behind times, because core can not evolve as quickly as = userland >>> does. That's why it's better done in extensions or user space - = unless >>> you can identify a case which covers a huge proportion of all cases = - >>> just like forms are for POST. For generic REST, I'm not sure there's >>> such case, except for very generic API giving access to the basic >>> request, its fields and supporting basic URL/MIME parsing. >>=20 >> Even just parsing JSON isn=E2=80=99t as simple as it sounds. There = are several >> things users might like to configure, several ways to parse JSON = (objects >> vs. arrays, big numbers as floats or strings, etc.), while for = form-data >> there=E2=80=99s only one way. >>=20 >=20 > Well, in this case it will be parsed as an array since $_POST is = naturally > parsed as an array. Also, since $_POST/$_GET are typically always = processed > as strings it would only make sense to use big numbers as strings in = the > JSON parsing as well. I don't think this is the big issue. The bigger = issue > is do users typically find the population of $_POST more useful than = just > reading the input stream themselves and handling the JSON payload on = their > own. Sherif - I=E2=80=99m just going to be straight here. I haven=E2=80=99t = seen support for your proposal at all in this thread. You continue to = try and make this case, but it continues to be shot down with absolutely = valid issues, and your only responsive action is to argue back. Why = aren=E2=80=99t you considering alternatives? Everything - and I do mean = everything - that you want is available in pecl/http, and there=E2=80=99s = already an RFC to get it into core. Why can=E2=80=99t you get behind = that and either support it, or move to propose an alternative that is = supportable by at least someone. Your current proposal is not supported = by anyone in this thread, and you still can=E2=80=99t see that. I admire and appreciate your efforts in making PHP better, but it=E2=80=99= s time to go back to the drawing board on this proposal. Everyone is = against it, and I feel this thread=E2=80=99s patience is running thin. >=20 >=20 >>=20 >> -- >> Andrea Faulds >> http://ajf.me/ --Apple-Mail=_ADB48D24-C0A3-4EFD-8708-574E3FFFDE26--