【发布时间】:2014-03-17 20:53:52
【问题描述】:
我收到此错误:
`file_get_contents(): stream does not support seeking
我不知道如何修复它。没有资源 ID 或任何东西。
这是我的代码:
$postData = array('name' => $name, 'description' => $description, 'date_begin' => $start, 'date_end' => $end);
$stream = array(
'http' => array(
'header' => "Content-type: application/x-www-form-urlencoded\r\n"
. "Authorization: Basic Y3Nub2VrOnNuMDNr\r\n",
'method' => 'POST',
'content' => http_build_query($postData)
)
);
return stream_context_create($stream);
并且在流返回的文件中。它的函数getApiContext。
$responseJson = json_decode(file_get_contents('http://10.0.0.89/api/v1/projects', false, BaseController::getApiContext(), true));
然后我得到了这个烦人的错误。我知道 cUrl,但我必须使用流。
【问题讨论】:
-
您是否在特定的代码行上得到了这个?对应的是哪一行?
标签: php