[Bug 650779] Re: stream_context_create + file_get_content doesn't retrieve full file

Christian Weiske cweiske at cweiske.de
Mon May 16 22:40:46 UTC 2011


This actually happens with a much smaller test script, as soon as you
use POST together with "content" in the context options.

<?php
$opts = array('http' => array('method'  => 'POST', 'content' => 'foo'));
$context = stream_context_create($opts);
$result = file_get_contents('http://localhost/poster.php', false, $context);
?>

result:
PHP Warning:  file_get_contents(http://localhost:4436/ResourceAll): failed to open stream: HTTP request failed!

When you remove the content key, all is fine.

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to php5 in Ubuntu.
https://bugs.launchpad.net/bugs/650779

Title:
  stream_context_create + file_get_content doesn't retrieve full file



More information about the Ubuntu-server-bugs mailing list