I need to send a GET request using the $http service. One of the parameters will be an array of identifiers. The URL looks like this: mysite.com/items?id [] = 1 & id [] = 2 & id [] = 3 & id [] = 4
I tried this approach
$http( method: 'GET', url: '/items', params: { id: ids
but url i obain - mysite.com/items?id=%5B%221%22%2C%222%22%2C%223%22%2C%224%22%5D
This is because Angular converts my value to a JSON string. Is there a way to get the behavior I want?
[Update]
I solved the problem thanks to Jonathan's suggestion using jQuery $.param() .
$http( method: 'GET' url: '/items?' + $.param({id: ids}) )
Gpx Nov 13 '13 at 15:32 2013-11-13 15:32
source share