Iam trying to send one json in POST request.
I created one NSMutableDictionary and added Key Value pairs, i have one NSMutableArray which contains Binary Stream of UIImage.
so When i Add this NSMutableArray into NSMutableDictionary and i did one NSLog
So result is
{
key:value,
key:value1,
ArrayKey:(
iuhdgbdsnb325435435j435bu4h5h45hu34h545ih43h5i43hi5hu3i4h5u3
)
}
but my expected JSON should be look like this
{
key:value,
key:value1,
ArrayKey:[
iuhdgbdsnb325435435j435bu4h5h45hu34h545ih43h5i43hi5hu3i4h5u3
]
}
"[" "]" square bracket is correct format, but iam getting "(" ")" .
I need NSMutableArray this in "[" "]" then only my server detect this json(after serialising this dictionary).
Please help my code is;
UIImage *yourImage= [UIImage imageNamed:@"test.jpg"];
NSData *imageData = UIImagePNGRepresentation(yourImage);
dict=[[NSMutableDictionary alloc]init];
arr1=[[NSMutableArray alloc]init];
[arr1 addObject:imageData];
[dict setObject:@"value" forKey:@"key"];
[dict setObject:@"value1" forKey:@"key1"];
[dict setObject:arr1 forKey:@"ArrayKey"];
Please help me