What is the recommended way to intercept and prevent redirects with AFNetworking 2.0?
It seems to me that the proper place to do this is in AFURLSessionManager , in setting the taskWillPerformHTTPRedirection block, but I am unsure of the best way to handle it. Currently, in my AFHTTPSessionManager subclass, I am setting the redirect block globally for all requests, and I know I can prevent redirects by returning nil here: - (void)setupRedirectBlock { [self setTaskWillPerformHTTPRedirectionBlock:^NSURLRequest *(NSURLSession *session, NSURLSessionTask *task, NSURLResponse *response, NSURLRequest *request) { return nil; }]; } ...but I need to only do this on specific tasks, and