【发布时间】:2015-01-31 23:48:29
【问题描述】:
/无法通过 php cURL 发送多维 Json 数组。 所以在下面的代码中,我将它作为对象数组发送,这在 python 中很难检索/
$_api_url="http://example.com" ;
$params = http_build_query(array('data_Details' => json_encode($request)));
//initialize and setup the curl handler
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $_api_url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,$params);
//execute request
$result = curl_exec($ch);
//close connection
curl_close($ch);
【问题讨论】:
标签: php json curl multidimensional-array