I have an array in this form:
(
{
itemId = 18;
itemPrice = "90.00";
itemQuantity = 100;
},
{
itemId = 17;
itemPrice = "88.00";
itemQuantity = 120;
}
)
I have to post it to Json server in this form
im[18][price]=90
im[18][stock]=100
im[18][check]=1
im[17][price]=88
im[17][stock]=120
im[17][check]=1
Please help me how to do this currently i am using the following code
for (NSInteger i = 0; i < selectedIdArray.count; i++)
{
mapData = [NSString stringWithFormat:@"api_key=bf45c093e542f057c123ae7d6&menu_name=%@&im[%@][price]=%@&im[%@][stock]=%@&im[%@][check]=%@",MenuNameStr,selectedIdArraySTR,selectedPriceArraySTR,selectedIdArraySTR,selectedQuantityArraySTR,selectedIdArraySTR,@"1"];
}
and it gives the following response
map data api_key=bf45c093e542f057c123ae7d6&menu_name=&im[18,17][price]=90.00,88.00&im[18,17][stock]=100,120&im[18,17][check]=1
Please someone help me out to send the following data separately to the server