I use Restkit to communicate with Drupal CMS. When I send the first request, everything works fine: I get the correct JSON-string -> awesome. Here is what the console says:
2011-06-24 23: 00: 48.344 MyApp [1399: 207] Sending a POST request to the URL http://mysite.com/myproject/services/rest/service_views/get.json . HTTP Body: view_name = viewsname
If the application tries to send the same request again, nothing happens. None of the delegate method methods. The console says:
2011-06-24 23: 03: 40.224 MyApp [1399: 207] Submitting a GET request to the URL http://www.mysite.com/myproject/services/rest/service_views/get.json . HTTP body:
I do all the Restkit things in a special class (singleton), which I save as an instance variable of my view controller. In the init function of this class, I do this:
RKObjectManager* objectManager = [RKObjectManager
objectManagerWithBaseURL:kBaseURLKey];
In my view controller I call a function - (void)pollForNewData
that 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 someone help me? Should I do something special after the first answer came? Is it possible to cancel the request (if the current view remains)?
source
share