Skip to content

Instantly share code, notes, and snippets.

@bauloc
Created April 6, 2016 10:37
Show Gist options
  • Save bauloc/ad45d93f4a52ac019b7746748becaac9 to your computer and use it in GitHub Desktop.
Save bauloc/ad45d93f4a52ac019b7746748becaac9 to your computer and use it in GitHub Desktop.
tesst
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