#27628 [Opn->Bgs]: stream http context

From: Date: Thu, 18 Mar 2004 00:31:59 +0000
Subject: #27628 [Opn->Bgs]: stream http context
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-56601@lists.php.net to get a copy of this message
ID: 27628 Updated by: pollita@php.net Reported By: php at virtualmonet dot com -Status: Open +Status: Bogus Bug Type: Output Control Operating System: linux PHP Version: 5CVS-2004-03-17 (dev) New Comment: Because that's not a complete POST request. You also need to specify the correct content-type (and preferrably content-length) in the header. (You can use the header context option for this) Refer to example2 on http://www.php.net/stream if you need an example of what the headers should look like. Previous Comments: ------------------------------------------------------------------------ [2004-03-17 16:25:29] php at virtualmonet dot com Description: ------------ hi; It seems that the Context option 'content' of HTTP wrapper for stream, does not pass the value to the server. Reproduce code: --------------- // === client side php code === $opts = array('http'=>array('method'=> "POST", 'content' => 'foo=bar')); $context = stream_context_create($opts); echo file_get_contents ($url, false, $context); // === server side php code === print $_POST['foo']; Expected result: ---------------- bar ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=27628&edit=1

« previous php.bugs (#56601) next »