RestKit GET Request with queryParameter: no matchi

2019-07-27 03:28发布

问题:

I'm trying to do a request with Restkit, but I get the following Error:

{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.}

Request-URL is: http://www.iwi.hs-karlsruhe.de/hskampus-news/api/kampus-api.php?getCategoriesNiceJSON

ResponseDescriptor looks like:

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

How can I configure my ResponseDescripter to match my request with the URL-Parameter?