使用queryParameter的RestKit GET请求:没有匹配的responseDescriptor

时间:2016-04-19 14:14:58

标签: ios url parameters response restkit

我正在尝试使用Restkit执行请求,但是我收到以下错误:

{Error Domain=org.restkit.RestKit.ErrorDomain Code=1001 "No mappable object representations were found at the key paths searched." UserInfo={NSLocalizedDescription=No mappable object representations were found at the key paths searched., NSLocalizedFailureReason=The mapping operation was unable to find any nested object representations at the key paths searched: 
This likely indicates that you have misconfigured the key paths for your mappings., keyPath=null, DetailedErrors=(
)}}, keyPath=null, NSLocalizedDescription=No response descriptors match the response loaded.}

请求网址是: http://www.iwi.hs-karlsruhe.de/hskampus-news/api/kampus-api.php?getCategoriesNiceJSON

ResponseDescriptor看起来像:

let newsCategoryResponseDescriptor = RKResponseDescriptor(mapping: NewsCategory.restKitObjectMapping(), method: RKRequestMethod.GET, pathPattern: Constants.Backend.NewsCategoryResource, keyPath: nil, statusCodes: RKStatusCodeIndexSetForClass(RKStatusCodeClass.Successful))

PathPattern:

hskampus-news/api/kampus-api.php?getCategoriesNiceJSON

如何配置ResponseDescripter以使我的请求与URL-Parameter匹配?

0 个答案:

没有答案