Мой RESTful API:Как настроить ресурс /: идентификатор с RestKit
GET http://example.com/articles
GET http://example.com/articles/:id
...
Heres мои настройки дескриптора:
RKResponseDescriptor *responseDescriptorArticleList = [RKResponseDescriptor
responseDescriptorWithMapping:articleMapping
method:RKRequestMethodGET
pathPattern:@"/articles"
keyPath:@nil
statusCodes:[NSIndexSet indexSetWithIndex:200]];
RKResponseDescriptor *responseDescriptorArticle = [RKResponseDescriptor
responseDescriptorWithMapping:articleMapping
method:RKRequestMethodGET
pathPattern:@"/articles/:id"
keyPath:nil
statusCodes:[NSIndexSet indexSetWithIndex:200]];
Функция для (ГЭТ) http://example.com/articles работает
[objectManager getObjectsAtPath:@"/articles"
parameters:nil
success:^sucess{...} failure:^failue{...}];
Функция для (GET) http://example.com/articles/:id не работает
//Whatever Object is article object or article.id, it doesn't work
[objectManager getObject:Object path:@"/articles/:id"
parameters:nil
success:^sucess{...} failure:^failue{...}];
Сервер консоль отображает:
GET /articles/:id 404 117ms
Очевидно, не заменить /: идентификатор с article.id
Я просмотрел в RestKit документы и примеры, которые, похоже, не обновляются для 0.20.x, и не нашел ответа. Я был бы благодарен за вашу помощь.