AFNetWorkingによるgetリクエストjeson、非jesonデータ


#pragma mark - JSON    -
-(void)dataGetRequest:(NSString*)urlStr{
    //          ,  
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    
    //           data,    
    manager.responseSerializer = [AFHTTPResponseSerializer serializer];
    //  get  
    [manager GET:urlStr parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) {
        NSLog(@"%@",[responseObject class]);
        self.imageView.image = [UIImage imageWithData:responseObject];
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        NSLog(@"error:%@",error);
    }];
    
}

#pragma mark -GET   JSON  -
-(void)jsonGetRequest:(NSString*)urlStr{
    
    //          ,  
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    
    //        json  
    manager.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"application/json", nil];
    //  get  
    [manager GET:urlStr parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) {
        //    
        NSLog(@"responseObject:%@",responseObject);
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        NSLog(@"error:%@",error);
    }];
    
}