NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://192.168.165.68:8080/xxxx/fileController/download.action"]];
AFHTTPRequestOperation *requestOperation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
requestOperation.responseSerializer = [AFHTTPResponseSerializer serializer];
[requestOperation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
NSLog(@"Response: %@", responseObject);
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
NSLog(@"error: %@", error);
}];
// [requestOperation setDownloadProgressBlock:^(NSUInteger bytesRead, long long totalBytesRead, long long totalBytesExpectedToRead) {
// NSLog(@"bytesRead = %d, totalBytesRead = %lld, totalBytesExpectedToRead = %lld", bytesRead, totalBytesRead, totalBytesExpectedToRead);
// }];
UIProgressView *progressView = [[UIProgressView alloc] initWithProgressViewStyle:UIProgressViewStyleBar];//[[UIProgressView alloc] initWithFrame:CGRectMake(30, 300, 200, 30)];
progressView.center = self.view.center;
[progressView setProgressViewStyle:UIProgressViewStyleDefault];
[progressView setProgressTintColor:[UIColor redColor]];
[progressView setProgressWithDownloadProgressOfOperation:requestOperation animated:YES];
[self.view addSubview:progressView];
[requestOperation start];