Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:63213 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 74656 invoked from network); 21 Sep 2012 11:31:43 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Sep 2012 11:31:43 -0000 Authentication-Results: pb1.pair.com smtp.mail=mountkin@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=mountkin@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.170 as permitted sender) X-PHP-List-Original-Sender: mountkin@gmail.com X-Host-Fingerprint: 209.85.217.170 mail-lb0-f170.google.com Received: from [209.85.217.170] ([209.85.217.170:58541] helo=mail-lb0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 85/71-62301-B105C505 for ; Fri, 21 Sep 2012 07:31:40 -0400 Received: by lbbgp3 with SMTP id gp3so4071023lbb.29 for ; Fri, 21 Sep 2012 04:31:36 -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=mrrjAmkDrIgNZP/MgT9+IuGOj5tTkpBwzCJ8X5dyrQs=; b=CixoNyWbsI1GXcJaLo6Wv2LsyXdMbkHK6ERgPcMoWzquH3HkS29GAN6oa+ogxhukks dNaFwGtQR7vsx1hcsBPqXnBZQxTjVGCTnUzsAMH3OyYrUlbwrxSFo6yh0fMHy27gihI3 xdwdfGviuFp6sS6zu53EhQDNxMyIdXKOLKUULbV/qkhVgb6u9n6LV3kybZTugFLEzklW oaKGTpRCz2WpdtwWbtoXdxNO1sAS4ujHURPnOZ/yFlEmuqpE52VP/HT9OQn6g5gE79or frcelJiE9Ih/JkV3P4RtMZWCLO16+W5Aa9iH/2+epU8FuqGX+p/70gOOdtV0sH53ULaP U2pw== MIME-Version: 1.0 Received: by 10.112.100.197 with SMTP id fa5mr1610177lbb.59.1348227096247; Fri, 21 Sep 2012 04:31:36 -0700 (PDT) Received: by 10.112.83.70 with HTTP; Fri, 21 Sep 2012 04:31:36 -0700 (PDT) In-Reply-To: <505C4A06.6040304@hoa-project.net> References: <505C4A06.6040304@hoa-project.net> Date: Fri, 21 Sep 2012 19:31:36 +0800 Message-ID: To: ivan.enderlin@hoa-project.net Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary=f46d0401fa3725ff6004ca3495e3 Subject: Re: [PHP-DEV] POST, content-type: application/json and json_decode From: mountkin@gmail.com (Starry Sky) --f46d0401fa3725ff6004ca3495e3 Content-Type: text/plain; charset=ISO-8859-1 Hi, This may lead to a BC break. If the post body contains a variable with the same name in the JSON, the $_POST will be confusing. On Fri, Sep 21, 2012 at 7:05 PM, Ivan Enderlin @ Hoa < ivan.enderlin@hoa-project.net> wrote: > Hello, > > If PHP receives a HTTP request with the method POST and with the header > Content-Type: application/x-www-form-**encoded, then, it automatically > parses the request body to populate an array in $_POST. If the Content-Type > is different (e.g. text/plain or application/json), the request body is > reachable by reading php://input. Well, it is ok. > > But is there any plans to consider application/json by parsing the request > body and populate the result in $_POST (with the help of json_decode() > maybe)? > > If so, I would like to propose a patch but I don't find in the source code > where request body is caugth and parsed (for POST). Any ideas? > Maybe a RFC would also be welcome to complete my suggestion? > > Thanks. > > -- > Ivan Enderlin > Developer of Hoa > http://hoa.42/ or http://hoa-project.net/ > > PhD. student at DISC/Femto-ST (Vesontio) and INRIA (Cassis) > http://disc.univ-fcomte.fr/ and http://www.inria.fr/ > > Member of HTML and WebApps Working Group of W3C > http://w3.org/ > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --f46d0401fa3725ff6004ca3495e3--