title: [function.file-get-contents]: failed to open stream: HTTP request failed
body: <p>Here is a snippet of my code:</p>
  
  <pre><code>include("JSON.php");
  $json = new Services_JSON();
  $value=array('jsonrpc'=&gt;'2.0', 'method'=&gt;'methodname', 'params'=&gt;array('param1',"param2"),'id'=&gt;1);
  $output = $json-&gt;encode($value);
  print($output);
  
  $opts = array(
    'http'=&gt;array(
      'method'=&gt;"GET",
      'header'=&gt;"Accept: application/json\r\n"."Content-type: application/json-rpc\r\n"."Content-Length:1000\r\n"  ,
   'user_agent'    =&gt; 'spider',
   'content'=&gt;$output
    )
  );
  
  $context = stream_context_create($opts);
  
  // Open the file using the HTTP headers set above
  $file = file_get_contents('link', false, $context);
  
  print($file);
   $value = $json-&gt;decode($file);
  ?&gt;
  </code></pre>
  
  <p>But I get this error:</p>
  
  <blockquote>
    <p>[function.file-get-contents]: failed to open stream: HTTP request failed</p>
  </blockquote>
  
  <p>I have tried seeing the settings in <em>php.ini</em> file, everyhting seems fine.
  I tried <code>file_get_contents('www.google.com')</code> and it worked.</p>