I have a WS that returns a plist.
I am using Restkit and I would like to display the answer.
So first, I initialize my ObjectManager as follows:
sharedInstance.manager = [RKObjectManager managerWithBaseURL:[NSURL URLWithString:ROOT_URL]];
I accept text / xml:
[[RKObjectManager sharedManager] setAcceptHeaderWithMIMEType:RKMIMETypeTextXML];
And I run my query:
NSMutableURLRequest *request = [[RKObjectManager sharedManager] requestWithObject:nil method:RKRequestMethodPOST path:@"/foo/foo" parameters:nil]; RKManagedObjectRequestOperation *operation = [[RKObjectManager sharedManager] managedObjectRequestOperationWithRequest:request managedObjectContext:[BddManager sharedInstance].manager.managedObjectStore.mainQueueManagedObjectContext success:^(RKObjectRequestOperation *operation, RKMappingResult *result) { NSLog(@"Loading mapping result: %d", result.count); } failure:^(RKObjectRequestOperation *operation, NSError *error) { NSLog(@"Fail!"); }]; [operation start];
Finally, I get this error:
NSLocalizedDescription=Expected content type {( "application/x-www-form-urlencoded", "application/json" )}, got text/xml,
What am I doing wrong?
source share