Question

I want to consume this api endpoint

.../country/search/{query}

another way would be

.../country/search?query={query}

however the api does not support that. How can I support the first style with restkit and not violate the path pattern?

pathPattern:@"/country/search/"

is not recognized by

getObjectsAtPath:[NSString stringWithFormat:@"country/search/%@", query]

so restkit fails to load the correct mapping.

Was it helpful?

Solution

Set your path pattern to:

pathPattern:@"country/search/:query"

See sockit for a description of hoe the path pattern matching works.

Also, ensure that your leading slashes match.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top