- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
因此,我当前用于更新对象的服务遵循以下 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 中添加项目。
最佳答案
您可以构建路径来添加参数。使用 pathPattern:@"/GetStuff"
将匹配构建的路径,例如:
@"/GetStuff?parm=Stuff&parm2=stuff2"
(如果添加或删除不在路径模式中的 /
字符,您将遇到问题)
关于ios - 发布路径必须与 RKResponseDescriptor pathPattern 完全匹配,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23203532/
我正在使用 RESTKit 执行 GET 请求,我的 RKResponseDescriptor 已弃用。我知道这是因为我没有方法参数,但我不知道我会为方法参数放什么。这是我当前的代码: RKRespo
我在使用 2 个实体的应用程序中使用 RestKit 0.20.0rc1: 一个“笔记”(NoteClass)。 一个“集合”(SetClass),其中包含一个音符集合。 我有以下 2 个响应描述符(
所以我对这两个功能有什么区别,或者至少,如何将它们合并在一起感到有点困惑。我有这种情况,我有这个描述符: RKResponseDescriptor *responsePlant = [RKRe
因此,我当前用于更新对象的服务遵循以下 URL 的格式 http://www.baseurl.com/servicemethodAddObject/transactionId?clientTime=c
在这种情况下最好的方法是什么? 我有通往里程碑资源的路径: GET: {baseURL}/rest/v2/common/plans/{id}/milestones 还有这条通往不同资源的路径: GET
我正在尝试做一些 RESTKit http 请求,当我使用 RKResponseDescriptor 代码行时,它说 'responseDescriptorWithMapping:pathPatter
我是一名优秀的程序员,十分优秀!