I am doing the post method
+ (void)getDataWithObject:(NSDictionary *)object onAPI:(NSString *)apiName withController:(UIViewController*)controller :(void(^)(BOOL success,id response,NSError *error))compilationHandler { controller = controller; [UIApplication sharedApplication].networkActivityIndicatorVisible = YES; AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
** for example, when we call the Service **
// calling service gateway API NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithObjectsAndKeys: "field",@"value", nil]; [self getDataWithObject:dict onAPI:KGet_Preferences withController:(UIViewController*)controller :^(BOOL success, id response, NSError *error) { if( success ) { NSMutableDictionary *data = [[response valueForKey:@"data"] valueForKey:@"preferences"]; compilationHandler(success,data,error); } else { compilationHandler(success,nil,error); } }];
source share