Last active
December 31, 2015 05:29
-
-
Save frontconnect/7941416 to your computer and use it in GitHub Desktop.
AFNetworking post wrapper
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(void) get:(NSString *)rest withParams:(NSDictionary*)params | |
completion:(void (^)(id))completionBlock | |
{ | |
NSString *curUrl = [self.constant.url stringByAppendingString:rest]; | |
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager]; | |
[manager GET:curUrl parameters:params success:^(AFHTTPRequestOperation *operation, id responseObject) { | |
//success | |
NSLog(@"rest: %@, response: %@", rest ,responseObject); | |
completionBlock(responseObject); | |
} failure:^(AFHTTPRequestOperation *operation, NSError *error) { | |
NSLog(@"rest: %@, error: %@", rest, error); | |
}]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment