我是使用 RESTKit 的新手。
我正在尝试使用postObject
.
我想知道我这样做是否正确。
我有这段代码:
self.gameWebInteractionObject = [[GameWebInteraction alloc] init];
RKObjectMapping *mapping = [RKObjectMapping mappingForClass:[NSMutableDictionary class]];
[mapping mapAttributes:@"id", @"firstname", @"lastname", @"email", @"createdGames", nil];
[self.gameWebInteractionObject.manager.mappingProvider setMapping:mapping forKeyPath:@""];
self.gameWebInteractionObject.manager.serializationMIMEType = RKMIMETypeJSON;
[self.gameWebInteractionObject.manager.router routeClass:[UserObject class] toResourcePath:@"/data" forMethod:RKRequestMethodPOST];
[self.gameWebInteractionObject.manager.mappingProvider setSerializationMapping:[mapping inverseMapping] forClass:[UserObject class]];
[self.gameWebInteractionObject.manager postObject:userobject delegate:self];