0

I'm using Restkit to communicate with Java Jersey REST server. I'm using a very simple method available on RKClient class, which is:

[[RKClient sharedClient] get:@"/userStatus" delegate:self];

The created methods in mw class are:

- (void)sendRequests
{  
    [[RKClient sharedClient] get:@"/userStatus" delegate:self];  
}  

- (void)request:(RKRequest*)request didLoadResponse:(RKResponse*)response
{  
    if ([request isGET])
    {  

        if ([response isOK])
        {  
        NSLog(@"Retrieved status: %@", [response bodyAsString]);  
        }  
    }
}

The problem is that I want to execute this GET several times, but it appears to work just once. Am I doing something wrong?

jrturton
  • 118,105
  • 32
  • 252
  • 268
Trein
  • 3,658
  • 27
  • 36
  • What happens when it doesn't work? What methods get called, or status codes returned, etc? – occulus Nov 21 '11 at 15:39
  • The (void)sendRequests method correctly triggered by the UIButton action, so the [[RKClient sharedClient] get:@"/userStatus" delegate:self]; is indeed called. The problem is that the server doesn't receive the request when the button is clicked more than once. – Trein Nov 21 '11 at 15:47

1 Answers1

1

It is working now! I really don't know which change I made to get it working. Probably the problem was the Jersey server. After modifying the GET method and adding some parameters to it (after all I figured out I needed some parameters to identify some resources) it started to work. Thank you anyway for the help.

Trein
  • 3,658
  • 27
  • 36