Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78099 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 55976 invoked from network); 15 Oct 2014 22:01:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Oct 2014 22:01:34 -0000 Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.41 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.41 mail-wg0-f41.google.com Received: from [74.125.82.41] ([74.125.82.41:63791] helo=mail-wg0-f41.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B4/00-55527-EBEEE345 for ; Wed, 15 Oct 2014 18:01:34 -0400 Received: by mail-wg0-f41.google.com with SMTP id b13so2416312wgh.24 for ; Wed, 15 Oct 2014 15:01:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type:subject:from:date:to :message-id; bh=Ry2gRQMDrAB+Sp9ZJTV82nerfuKEXry37NPHgXl53hY=; b=tcGwhxbi49K9Zn+Q6Vy7LJw/AOVhktsD7oZatntMkTTRv1NERjDWvTQeMEiTBTUSbc goitnfx57grMaEQRgrFMigo17JYsjPfGTtdLqR4vpklO5FXnP3f70kkkwkU4ceiot5E4 7WvwK1KP3/9M3Z16APlo9q4aFyBZIIEUzDB9fvbXylg68OocWMf4aaFFnzmr+vC8xD54 ZauaPaD80ojsC9xOeYUqqF3CmBVUVrLKETDZxqR63R+y8nyz49sY1qf6SqAOB24AzVyA v2wgtDPdldcxyR9ZbMCpWd9RO2JPicG9765vuhDCPiK3ufjhpEbVCW/C7V4fgsNeCp8r zT+w== X-Received: by 10.195.13.83 with SMTP id ew19mr13495281wjd.95.1413410490650; Wed, 15 Oct 2014 15:01:30 -0700 (PDT) Received: from [192.168.0.3] (cpc68956-brig15-2-0-cust215.3-3.cable.virginm.net. [82.6.24.216]) by mx.google.com with ESMTPSA id pn4sm10327503wjc.38.2014.10.15.15.01.29 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 15 Oct 2014 15:01:29 -0700 (PDT) User-Agent: K-9 Mail for Android 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> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Date: Wed, 15 Oct 2014 23:01:26 +0100 To: internals@lists.php.net Message-ID: <3AF53324-F25C-4085-8124-E7EA53045D9D@gmail.com> Subject: Re: [PHP-DEV] New globals for PUT and DELETE From: rowan.collins@gmail.com (Rowan Collins) On 15 October 2014 22:14:32 GMT+01:00, Ralph Schindler wrote: >>> I'm not sure I understand what you're trying to do, could you >explain in >>> more detail with examples? >> >> PUT /url >> Content-type: application/x-www-form-urlencoded >> >> parse_str (file_get_contents(‘php://input'), $_POST) // Ok >> >> PUT /url >> Content-type: multipart/mixed; boundary="xxxx" >> >> file_get_contents(‘php://input') // Empty string > >Here is a demonstration of this script, and a successful read of the >request body: > > $ echo 'FOOOO=BARRRRR' | http --verbose PUT localhost:8000 \ > Content-Type:'multipart/mime; boundry=xxxxx' > > PUT / HTTP/1.1 > Accept: application/json > Accept-Encoding: gzip, deflate > Content-Length: 14 > Content-Type: multipart/mime; boundry=xxxxx > Host: localhost:8000 > User-Agent: HTTPie/0.8.0 I'm not sure if itmakes a difference, but you mistyped the content type there: it should be `multipart/mixed`, not `multipart/mime`. There may also be version differences at play here, because I think the behaviour of php://input has been changed a couple of times.