I know it has been long since you posted the question. However it could help other people looking for the same thing.
Assuming that transfer
is your controller and transfers
is the function, another way to format your url could be:
http://example.com/api/transfer/transfers?code[]=456&code[]=234
This was you perform $this->get('code')
you'll get an array back.
If you are creating the url via code then you may use http_build_query()
. It handles the necessary escaping. It means it will replace [
for %5B
and ]
for %5D
, in this case.
The code would be like:
$codes = array(456, 234);
$query = http_build_query(array('code' => $data));
$url = 'http://example.com/api/transfer/transfers?' . $query;