【发布时间】:2014-04-21 18:35:21
【问题描述】:
所以我用于更新对象的当前服务遵循以下 URL 的格式
http://www.baseurl.com/servicemethodAddObject/transactionId?clientTime=clientTime
这就是我放在那里的代码。大概。
[objectManager addResponseDescriptor:[RKResponseDescriptor responseDescriptorWithMapping:eventResponseMapping method:RKRequestMethodGET pathPattern:@"/GetStuff" keyPath:nil statusCodes:RKStatusCodeIndexSetForClass(RKStatusCodeClassSuccessful)]];
// I'd want to add items to the URL but the parameters parameter only goes in to the post body, If I add objects to the path @"?GetStuff/?parm=Stuff&parm2=stuff2" then the response will not be mapped properly
[objectManager postObject:object path:@"/GetStuff" parameters:parms success:nil failure:nil];
似乎 RestKit 要求用于发布对象的路径和用于创建 RKDescriptor 的 pathPattern 必须完全匹配。有没有办法让restKit进行忽略其对象映射的url参数的比较?
这是正确的做法吗?在 URL 中发布对象并添加项目。
【问题讨论】: