【问题标题】:post access using file_get_contents doesn't solve 411 error on using content length使用 file_get_contents 发布访问不能解决使用内容长度的 411 错误
【发布时间】:2013-04-10 07:11:06
【问题描述】:

我正在尝试使用file_get_contents 访问帖子数据,但是我收到以下错误消息:

failed to open stream: HTTP request failed! HTTP/1.0 411 Length Required

虽然我使用了Content-Length field,但错误并没有得到解决。如果有人可以帮助我,这是我的代码,在此先感谢。

<?php
set_time_limit(0);
include "ui.php";
$oy= `perl E:/mul.pl`;
$context  = stream_context_create(array('http' => array('method'=>'POST', 'header'  => 'Content-type: application/x-www-form-urlencoded', 'Content-Length: 0', 'content' => '')));
$result = file_get_contents($oy, false, $context);
?>

【问题讨论】:

    标签: php http


    【解决方案1】:

    【讨论】:

      猜你喜欢
      • 2017-11-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-04-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多