Created
April 6, 2016 10:37
-
-
Save bauloc/ad45d93f4a52ac019b7746748becaac9 to your computer and use it in GitHub Desktop.
tesst
This file contains 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
AFHTTPRequestOperationManager *manager = [[AFHTTPRequestOperationManager alloc] init]; | |
AFHTTPRequestOperation *op = [manager GET:requestURLString parameters:parameter success:^(AFHTTPRequestOperation *operation, id responseObject) { | |
NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingAllowFragments error:nil]; | |
DDLog(@"%@", dic); | |
block(dic); | |
} failure:^(AFHTTPRequestOperation *operation, NSError *error) { | |
NSLog(@"%@", [error description]); | |
failureBlock(); | |
}]; | |
op.responseSerializer = [AFHTTPResponseSerializer serializer]; | |
[op start]; | |
/* | |
AFHTTPRequestOperationManager *manager = [[AFHTTPRequestOperationManager alloc] init]; | |
manager.responseSerializer = [AFHTTPResponseSerializer serializer]; | |
[manager GET:requestURLString parameters:parameter success:^(AFHTTPRequestOperation *operation, id responseObject) { | |
NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingAllowFragments error:nil]; | |
DDLog(@"%@", dic); | |
block(dic); | |
} failure:^(AFHTTPRequestOperation *operation, NSError *error) { | |
NSLog(@"%@", [error description]); | |
failureBlock(); | |
}]; | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment