I need to pass custom HTTPHeader for fetch image but getting error 401. Same token is working for other api.
Header is passed in sdwebimage requesturl:
I am passing custom headers like below code.
SDWebImageDownloader *manager = [SDWebImageManager sharedManager].imageDownloader;
[manager setValue:[DefaultsValues getStringValueFromUserDefaults_ForKey:kTokenKey] forHTTPHeaderField:@"authToken"];
[manager setValue:[DefaultsValues getStringValueFromUserDefaults_ForKey:kUserEmail] forHTTPHeaderField:@"email"];
[manager downloadImageWithURL:[NSURL URLWithString:@"URL STRING"] options:SDWebImageDownloaderUseNSURLCache progress:^(NSInteger receivedSize, NSInteger expectedSize, NSURL * _Nullable targetURL) {
NSLog(@"%tu",receivedSize);
} completed:^(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, BOOL finished) {
if (error == nil) {
cell.profileImage.image = image;
}
}];