我收到此错误:
`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,但必须使用流。
你为什么用true
你的file_get_contents
OFFSET PARAM?也许您打算将其放入,json_decode
如果可以,请尝试以下操作:
$responseJson = json_decode(file_get_contents('http://10.0.0.89/api/v1/projects', false, BaseController::getApiContext()),true);
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句