I am trying to simply get the text displayed in the resulting page but it look like this code snipped is looking specifically for JSON only.
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
NSDictionary *parameters = @{@"userId": [loggedParent getObjectID]};
[manager POST:@"http://myurl" parameters:parameters success:^(AFHTTPRequestOperation *operation, id responseObject) {
NSLog(@"JSON: %@", responseObject);
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
NSLog(@"Error: %@", error);
}];
This is the error I get:
Error Domain=NSCocoaErrorDomain Code=3840 "The operation couldn’t be completed. (Cocoa error 3840.)" (JSON text did not start with array or object and option to allow fragments not set.) UserInfo=XXXXXXXXX {NSDebugDescription=JSON text did not start with array or object and option to allow fragments not set.}
How do I modify my code to simply read and save the text that is displayed?
NSLog
statement showing theresponseObject
? – rmaddy