Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78100 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 58551 invoked from network); 15 Oct 2014 22:51:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Oct 2014 22:51:05 -0000 Authentication-Results: pb1.pair.com smtp.mail=park.framework@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=park.framework@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.218.49 as permitted sender) X-PHP-List-Original-Sender: park.framework@gmail.com X-Host-Fingerprint: 209.85.218.49 mail-oi0-f49.google.com Received: from [209.85.218.49] ([209.85.218.49:62150] helo=mail-oi0-f49.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 09/60-55527-95AFE345 for ; Wed, 15 Oct 2014 18:51:05 -0400 Received: by mail-oi0-f49.google.com with SMTP id a3so1772191oib.22 for ; Wed, 15 Oct 2014 15:51:01 -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:content-transfer-encoding; bh=9x6//d8Ualiehw4VCVP6VR+ptpqnGBVtb6l3H1+D3PE=; b=yMOLJ1cXrMqBvSAWYVVcYvL38jlEBqhfoJGGMrHZQu0NoxMljQXY8Zc7nkcQfVsdG8 rJzGCeq8X8GDLrKKexkXVo29yC9DWva0Kl2EdzeU+Y+ezHEfyvDwPTUyNyRbEXC8L0WQ 1JUtcpdlLR5WkNWJnrxMwiZ4x9S1dnBeBGDkxauvIXi/vQN4t2nFu/hPl0SROTGwCXFB jwHkgGpZuU66MgIeD9qr6JZ+Basrd9R1PUsbvalNDaOxh+pxnqarjVQTLDaP+j9+KgMl QxVZv2tMJXfMUEX35tnpNL3hk0HJ8S6KxhK6D4edj/ekUSEC++ZhKAGl1d8jr/glKRDd NyBw== MIME-Version: 1.0 X-Received: by 10.60.76.72 with SMTP id i8mr4882728oew.53.1413413461757; Wed, 15 Oct 2014 15:51:01 -0700 (PDT) Received: by 10.76.23.37 with HTTP; Wed, 15 Oct 2014 15:51:01 -0700 (PDT) In-Reply-To: <543EE3B8.7010407@ralphschindler.com> References: <776669CE-9E8C-4069-9834-C7275CCA0EF4@ajf.me> <8CB055D4-F164-4DF3-B019-684BAE7E016E@ajf.me> <543D47C1.9050009@lerdorf.com> <543D4CE1.5000109@lerdorf.com> <543D6864.10508@gmail.com> <543D85E6.2020507@lerdorf.com> <57b7a3681d6c2c7ae123c8921b2d19d6@mail.gmail.com> <543DCE2B.8010506@sugarcrm.com> <543EE3B8.7010407@ralphschindler.com> Date: Thu, 16 Oct 2014 01:51:01 +0300 Message-ID: To: Ralph Schindler Cc: PHP internals Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] New globals for PUT and DELETE From: park.framework@gmail.com (Park Framework) Ok, i did a little test script, you can check, the browser sends to the server a request body, but var_dump(file_get_contents('php://input')) // string(0) "" Do not forget to select a file to upload.

2014-10-16 0:14 GMT+03:00 Ralph Schindler : >>> I'm not sure I understand what you're trying to do, could you explain i= n >>> more detail with examples? >> >> >> PUT /url >> Content-type: application/x-www-form-urlencoded >> >> parse_str (file_get_contents(=E2=80=98php://input'), $_POST) // Ok >> >> PUT /url >> Content-type: multipart/mixed; boundary=3D"xxxx" >> >> file_get_contents(=E2=80=98php://input') // Empty string > > > You are missing information in your example. First, PHP doesn't do conte= nt > negotiation for every Content-Type known to send serialized data, it is > extremely selective in that AFAIK, url/form encoded Content-Types, when > POSTed, will be content-negotiated, parsed, and their resultant will > populate the $_POST superglobal. > > Moreover, your 2nd example does not suggest that an HTTP request was sent > with a body to demonstrate there is a bug here. > > With a php script being served at index.php with the following contents: > > var_dump(file_get_contents('php://input')); > > Here is a demonstration of this script, and a successful read of the requ= est > body: > > $ echo 'FOOOO=3DBARRRRR' | http --verbose PUT localhost:8000 \ > Content-Type:'multipart/mime; boundry=3Dxxxxx' > > PUT / HTTP/1.1 > Accept: application/json > Accept-Encoding: gzip, deflate > Content-Length: 14 > Content-Type: multipart/mime; boundry=3Dxxxxx > Host: localhost:8000 > User-Agent: HTTPie/0.8.0 > > FOOOO=3DBARRRRR > > HTTP/1.1 200 OK > Connection: close > Content-type: text/html > Host: localhost:8000 > X-Powered-By: PHP/5.5.15 > > string(14) "FOOOO=3DBARRRRR > " > > > -ralph > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php >