3

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.

Wain
  • 118,658
  • 15
  • 128
  • 151
DarkLeafyGreen
  • 69,338
  • 131
  • 383
  • 601

1 Answers1

5

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.

Wain
  • 118,658
  • 15
  • 128
  • 151