我的脚本中有一段这样的代码
$postData = http_build_query($data);
$options = array('http' => array(
'method' => 'POST',
'header' => 'Content-type: application/x-www-form-urlencoded' . PHP_EOL,
'content' => $postData
));
$url = 'http://evergreens.bitrix24.ru/crm/configs/import/lead.php';
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
但远程服务器'常青树......'回应错误。如果我使用jquery发布帖子请求它没关系,但它不能与php一起工作,因为我需要在用户的脚本中隐藏auth数据。 我想发送数据必须完全是$ _POST数组,可能是我错了...... 原来错误是俄语:
{'error':'400','error_message':'Ошибка запроса'}
在英语中,它听起来像'Request error'
。
答案 0 :(得分:0)
好像你要将数据发布到http://evergreens.bitrix24.ru 我认为发布到此URL可能需要某种身份验证,如HTTP标头或类似的东西。网站可能需要知道哪个用户正在发布数据