I've got an issue with posting an array of strings to the server:
My Mapping is this:
+(RKMapping*)occurrenceCreateMapping {
RKObjectMapping *occurrenceCreateMapping = [RKObjectMapping requestMapping];
[occurrenceCreateMapping addAttributeMappingsFromDictionary:@{
@"observedOn" :@"ObservedOn",
@"latitude" :@"Latitude",
@"longitude" :@"Longitude",
@"address" :@"Address",
@"host" :@"Host",
@"pests" : @"Pests",
@"networkId" :@"NetworkId",
@"consignmentNumber" :@"ConsignmentNumber"
}];
return occurrenceCreateMapping;
}
But what is actually getting posted is this:
Which is invalid because my server side model binder is expecting a single array of strings.
This is the code for my OccurrenceCreate Class:
@interface BBOccurrenceCreate : NSObject
@property (nonatomic, retain) NSDate *observedOn;
@property CGPoint location;
@property (nonatomic, retain) NSString *latitude,
*longitude,
*address,
*host,
*consignmentNumber,
*networkId;
@property (nonatomic,retain) NSArray *pests;
@end
Can anyone help me map this array of strings to a json array? I'm thinking this should be simple ?!?!