我正在尝试将发布数据发送到我的服务器。
$url = 'http://my_server';
$data = http_build_query(array(
"conditions" => [
["id", "1", "equal"],
["jd", array("a" => "b",
"c" => "d"), "equal"]
]
));
$options = array(
'http' => array (
'method' => 'POST',
'ignore_errors' => true,
'content' => $data
)
);
$result = file_get_contents($url, false, $options);
在代码所在的服务器上ruby
,我收到的参数为
参数:{"conditions"=>{"1"=>{"0"=>"jd", "1"=>{"c"=>"d", "a"=>"b"}, " 2"=>"等于"}, "0"=>{"0"=>"id", "1"=>"1", "2"=>"等于"}}
虽然我想收到
参数:{"conditions"=>[["id", "1", "equal"], ["jd", {"c"=>"d", "a"=>"b"}, "equal "]]
我能做些什么?我需要使用其他方式发送数据吗?