after searching docs and trying out some codes I got following as an example
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
manager.requestSerializer = [AFJSONRequestSerializer serializer];
NSDictionary *params = @ {@"user" :txtUserName, @"pwd" :txtPwd };
[manager POST:URL_SIGNIN parameters:params
success:^(AFHTTPRequestOperation *operation, id responseObject)
{
NSLog(@"JSON: %@", responseObject);
}
failure:
^(AFHTTPRequestOperation *operation, NSError *error) {
NSLog(@"Error: %@", error);
}];
Also don't forget to set response header type in the server script as Application/json.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…