Restkit sending mail using loadObjectsAtResourcePath

If I make a request with restkit, I can use the general client to send message parameters. How can I do the same with the general object manager, there seems to be no function to publish data when objects are requested.

For re-iteration, I want to send some data after I use loadObjectsAtResourcePath

thank

+3
source share
2 answers

Should loadObjectsAtResourcePath be used? Here is what I use to send POST requests to my server

    RKParams* params = [RKParams params];
    [params setValue:@"The text" forParam:@"text"];

    RKClient* myClient = [RKClient sharedClient];
    [myClient post:resourceURL params:params delegate:self];

And you will get an answer using

    - (void)request:(RKRequest *)request didLoadResponse:(RKResponse *)response

PS: Just found this link: https://github.com/RestKit/RestKit/wiki/Posting-NSDictionary-as-JSON

+3
source

, :

[[RKObjectManager sharedManager] loadObjectsAtResourcePath:@"/monkeys.json" usingBlock:^(RKObjectLoader* loader) {
     loader.objectMapping = [[RKObjectManager sharedManager].mappingProvider objectMappingForClass:[Monkey class]];
     loader.method = RKRequestMethodPOST;
}];

https://github.com/RestKit/RestKit/blob/master/Code/ObjectMapping/RKObjectManager.h#L374

+1

All Articles