Created
April 25, 2012 18:55
-
-
Save FlaviuSim/2492237 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// make the post using the objectManager if you want to map the response to a model | |
RKObjectManager* objectManager = [RKObjectManager sharedManager]; | |
[objectManager loadObjectsAtResourcePath:@"/api/" delegate:self block:^(RKObjectLoader* loader) { | |
loader.serializationMIMEType = RKMIMETypeJSON; // We want to send this request as JSON | |
loader.objectMapping = [objectManager.mappingProvider objectMappingForClass:[Plan class]]; | |
loader.resourcePath = @"/api/"; | |
loader.method = RKRequestMethodPOST; | |
loader.params = [RKRequestSerialization serializationWithData:[jsonString dataUsingEncoding:NSUTF8StringEncoding] MIMEType:RKMIMETypeJSON]; | |
}]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment