I have a REST endpoint that returns a BOOL value depending on whether or not the server operation was successful. It returns the response body as simply true or false
When I try to decode the value from the server, I get the following error:
Unexpected token, wanted '{', '}', '[', ']', ',', ':', 'true', 'false', 'null', '"STRING"', 'NUMBER'.
I have gone so far as to remove the server response the equation. Now I am just trying to get this code to work:
NSString *result = @"true";
NSNumber *response = [ result objectFromJSONStringWithParseOptions:JKParseOptionNone error:&err ];
if( response == NULL )
NSLog(@"error: %@", err.localizedDescription );
else
NSLog( @"%d", ( int )response );
No matter what, I still run into my error condition and print out the error message:
Unexpected token, wanted '{', '}', '[', ']', ',', ':', 'true', 'false', 'null', '"STRING"', 'NUMBER'.
What am I missing?
"true"isnt a valid json string