I\'ve setup a JSON post with AFNetworking in Objective-C and am sending data to a server with the following code:
AFHTTPRequestOperationManager
In my case, it's looks like (maybe it can helps)
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
manager.requestSerializer = [AFJSONRequestSerializer serializer];
[manager POST:url parameters:params
success:^(AFHTTPRequestOperation *operation, id responseObject) {
NSDictionary *jsonDict = (NSDictionary *) responseObject;
//!!! here is answer (parsed from mapped JSON: {"result":"STRING"}) ->
NSString *res = [NSString stringWithFormat:@"%@", [jsonDict objectForKey:@"result"]];
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
//....
}
];
Also would be great to check type of response object (like https://stackoverflow.com/a/21962445/3628317 answer)