I\'m having a similar issue to the one discussed here.
I\'m attempting to post JSON to a server.
Here\'s the Objective-C code that should work, but
I too had this issue recently, I had the following parameters to be sent to the server, but the "feature" array was breaking into 4 parts rather than just 2 dictionaries.
{ "description": "Temporary Description",
"name": "Product Name",
"feature": [
{
"fkey": "FT1",
"fvalue": "FD1"
},
{
"fkey": "FT2",
"fvalue": "FD2"
}
]
}
So I changed the
AFURLRequestSerialisation.m
replaced this line in AFQueryStringPairsFromKeyAndValue(NSString *key, id value) method
[mutableQueryStringComponents addObjectsFromArray:AFQueryStringPairsFromKeyAndValue([NSString stringWithFormat:@"%@[]", key], nestedValue)];
with
[mutableQueryStringComponents addObjectsFromArray:AFQueryStringPairsFromKeyAndValue([NSString stringWithFormat:@"%@[%i]", key, [array indexOfObject:nestedValue]], nestedValue)];
And this did the trick. I hope this might help someone.