I was experimenting with restkit and appears to be an issue in the router class. My API server by default has the resource_uri for every objects, that means something like this:
/path/to/resource/id/
So, when I want to update the object (user in this case) I would like to do just like this:
[router routeClass:[user class] toResourcePath:@":resource_uri" forMethod:RKRequestMethodPUT];
Because the user object has the whole path as one of its instance variables. Also it has his own id, but I think this way is simpler.
The problem is that when I do debugging, :resource_uri is mapped with uri encoding so I gets something ugly like:
%2Fpath%2Fto%2Fresource%2Fid%2F
And this makes my request to fail, because the url is not correctly understood.
I solved this issue using the user id instead, setting the router like:
[router routeClass:[user class] toResourcePath:@"/api/resources/userprofile/:user_id/" forMethod:RKRequestMethodPUT];
But I would like to know if is there a way to overcome the uri encoding.
You can pass escapeRoutedPath:NO like: