ios - RestKit does not recognize path pattern with params -
i have path pattern
api/v1.2/user/:userid/friends
for list friends given userid
it simple query, register responsedescriptors key path, , call api method like
[self.api getobjectsatpath:@"api/v1.2/user/:userid/friends" parameters:@{ @"userid" : @1 } success:^(rkobjectrequestoperation *operation, rkmappingresult *result) { nslog(@"friends"); } failure:^(rkobjectrequestoperation *operation, nserror *error) { nslog(@"error"); }];
i got error , full url path http://localhost/api/v1.2/user/:userid/friends?userid=1
restkit not replace path param.
but use retrofit in android programming, , there it's do
@get("/group/{id}/users") list<user> grouplist(@path("id") int groupid);
how restkit replace path params?
you can't compare different libraries different platforms...
to inject parameters need use rkroute
set request. route deals creating path , injecting parameters calling getobjectsatpath
not attempt inject parameters.