您应该使用PATCH进行更新,并使用DELETE直接删除,而不是对两个操作调用POST。
RKObjectManager *manager = [RKObjectManager managerWithBaseURL:[NSURL URLWithString:@"http://restkit.org"];
[manager addRequestDescriptor:requestDescriptor];
[manager addResponseDescriptor:responseDescriptor];
// POST to create
[manager postObject:article path:@"/articles" parameters:nil success:nil failure:nil];
// PATCH to update
article.body = @"New Body";
[manager patchObject:article path:@"/articles/1234" parameters:nil success:nil failure:nil];
// DELETE to destroy
[manager deleteObject:article path:@"/articles/1234" parameters:nil success:nil failure:nil];
从新的RestKit Docs中检查此link。
OP明确表示他目前只能使用POST,没有理由复制一些他目前无法使用的方法的文档...... – allaire
@allaire,你是对的,我完全误解了这个问题。对不起。 – clopez