-(void)requestQNWithdata:(NSData *)data{
AFManagerHelp *manager = [[AFManagerHelp alloc]init];
[manager POST:uploadNOToken Splice:nil parameters:nil success:^(id responseObject) {
NSString *upToken = [responseObject objectForKey:@
"uptoken"
];
NSLog(@
"token::===== %@"
,upToken);
[self uploadPictureToQiNiu:data withToken:upToken];
} failure:^(NSError *error) {
NSLog(@
"QNerror==%@"
,error.userInfo);
}];
}
-(void)uploadPictureToQiNiu:(NSData *)data withToken:(NSString *)token{
QNUploadManager *upManager = [[QNUploadManager alloc]init];
QNUploadOption * uploadOption= [[QNUploadOption alloc] initWithMime:nil progressHandler:^(NSString *key, float percent) {
NSLog(@
"QNpercent == %.2f"
,percent);
} params:nil checkCrc:NO cancellationSignal:nil];
[upManager putData:data key:nil token:token complete:^(QNResponseInfo *info, NSString *key, NSDictionary *resp) {
NSLog(@
"QNinfo ===== %@\nQNresp========%@"
,info,resp);
} option:uploadOption];
}