I’m using Restkit to communicate with Drupal CMS. When I’m sending the
first request everything works fine: I’m getting the correct JSON-
string -> awesome. This is what the console says:
2011-06-24 23:00:48.344 MyApp[1399:207] Sending POST request to URL
http://mysite.com/myproject/services/rest/service_views/get.json. HTTP
Body: view_name=viewsname
If the app tries to send the same request again, nothing happens. None
of the delegate-methods get called. The console says:
2011-06-24 23:03:40.224 MyApp[1399:207] Sending GET request to URL
http://www.mysite.com/myproject/services/rest/service_views/get.json.
HTTP Body:
I’m doing all the Restkit stuff in a special-class (singleton), which
I keep as an instance variable of my view-controller. In the init-function of this
class I am doing this:
RKObjectManager* objectManager = [RKObjectManager
objectManagerWithBaseURL:kBaseURLKey];
In my view-controller I’m calling a - (void)pollForNewData function,
which does the following:
RKObjectLoader* objectLoader = [[RKObjectManager sharedManager] loadObjectsAtResourcePath: kRessourceKey objectClass:[RKNotification class] delegate:self];
objectLoader.method = RKRequestMethodPOST;
objectLoader.params = [NSDictionary dictionaryWithKeysAndObjects: @"view_name", @"viewsname", nil];
[objectLoader send];
Can anybody help me? Do I have to do something special after the first
response came? Is it possible to cancel a request (if the current view was left)?
Current RestKit source (~0.9.2+) doesn’t seem to have loadObjectsAtResourcePath:objectClass:delegate: method.
You could use something like this:
Hope it helps.