我正在使用一个使用 POST 请求和 Zend_Http_Client 的 API。
我需要查询字符串来模拟看起来像的获取请求?id=5&id=10&fileName=Sample-Document
。如您所见,有两个 id 参数。有没有办法使用 Zend_Http_Client 和 $_POST 请求来做到这一点?
到目前为止,这是我的代码:
$client = new Zend_Http_Client();
.
..
... $client->config stuff goes here
..
.
$data = array('id'=>array('5', '10')), 'fileName'=>'Sample-Document');
$client->setParameterPost($data['fileName'], 'fileName');
// theoretically, i'd like to do it like this, but it doesn't work since i think the second line overwrites the first
$client->setParameterPost('id', ($data['id'][0]);
$client->setParameterPost('id', $data['id'][1]);
$client->request('POST');