上传的参数格式
修改方法如下
找到AFNetWorking 下的AFURLRequestSerialization.m文件然后再找到AFQueryStringPairsFromKeyAndValue方法会看到下图这句话
NSArray *array = value; for (id nestedValue in array) { [mutableQueryStringComponents addObjectsFromArray:AFQueryStringPairsFromKeyAndValue([NSString stringWithFormat:@"%@[]", key], nestedValue)]; }
直接跟改为
for (id nestedValue in array) { [mutableQueryStringComponents addObjectsFromArray: AFQueryStringPairsFromKeyAndValue( [NSString stringWithFormat:@"%@[%lu]", key,(unsigned long)[array indexOfObject:nestedValue]], nestedValue)]; }
for (id nestedValue in array) { [mutableQueryStringComponents addObjectsFromArray: AFQueryStringPairsFromKeyAndValue( [NSString stringWithFormat:@"%@[]", key,(unsigned long)[array indexOfObject:nestedValue]], nestedValue)]; }
for (id nestedValue in array) { [mutableQueryStringComponents addObjectsFromArray:AFQueryStringPairsFromKeyAndValue([NSString stringWithFormat:@"%@", key], nestedValue)]; }
传输FROM样式 分别为
原文:https://www.cnblogs.com/frounk/p/14704285.html