Php cURL Post HTTP';通过发送到Django站点正确工作

Php cURL Post HTTP';通过发送到Django站点正确工作,php,curl,Php,Curl,大家 我需要将一些表单数据发送到另一个url,当我尝试发送buy html时,它工作正常,但是当我使用cURL时,我收到以下消息“MultiValueDictKeyError” 这个卷曲请求的来源是什么 &url = http://someurl.com; $user = 'info@some.email'; $scenario_id = 100; $order_id = rand(0, 999999999999); $ch = curl_init(); curl_setopt($ch

大家

我需要将一些表单数据发送到另一个url,当我尝试发送buy html时,它工作正常,但是当我使用cURL时,我收到以下消息“MultiValueDictKeyError”

这个卷曲请求的来源是什么

&url = http://someurl.com;
$user = 'info@some.email';
$scenario_id = 100;
$order_id = rand(0, 999999999999);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch, CURLOPT_HEADER, false); 
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query('user=$user&scenario_id=$scenario_id&order_id=$order_id'));     
$result = curl_exec($ch);
而不是:

&url = http://someurl.com;
此外:
http_build_query需要一个数组或对象,而不是字符串。

我以前更改过它,但它不起作用。那么您现在使用的代码是什么,错误是什么?该代码适用于PHP服务器,但我在Django网站的“scenario_id”值上收到了“MultiValueDictKeyError”,我编辑了上述答案。
&url = http://someurl.com;