am just starting off with restkit for ios. I have a very simple json response
{
“result”: [
{
“userid”: “5964”,
“name”: “Your Name”
}
]
}
This is a valid json (tested against jsonlint)
However, when i try to use this with RKClient, it doe’snt see it as json. This is my code
-(void) request:(RKRequest *)request didLoadResponse:(RKResponse *)response{
if([request isGET]){
if([response isJSON]){
NSLog(@"JSON Response from Server %@", [response bodyAsString] );
}else{
NSLog(@"Non JSON Response from Server %@", [response bodyAsString] );
}
}
}
It always logs “Non JSON Reponse….” but the json is perfectly valid. The same thing happens when i use RKObjectMapping; the error will be “Unable to find parser for MIME Type text/xml.
Any help is highly appreciated.
Thanks
I was a bit dumb, but things got solved once i added
to the server script.