in a spring web application I'm trying to send object list as request data. I can send the json object list in message body and parse in POST but I'm having trouble send the same data through url for GET. in json the list structure is as follows
{
"vendorIDs": [{
"vendorID": [111,1000]
},{
"vendorID": [3300]
}]
}
how do i send the above list through url and how do parse the list in server end? I have tried sending as
xyz.zyz/search?vendorIDs={"vendorID":["111","1000"],"vendorID":["3300"]}
and parsing as
@RequestMapping(value="/search", method=RequestMethod.GET)
public returntype myMethod(@RequestParam(value="vendorIDs") List<vendorID> vendorIDs) throws Exception{
//operation
return;
}
is it at all possible to send such list through url encoding? where am I going wrong about it?