I'm sending a HTTP GET request to an URL using NSURLConnection with the delegate. The request gets redirected with a HTTP 302 and the new request is performed and the data retrieved.
The problem is that I don't want the body of the redirected HTTP request but the content of the original redirect response.
I've implemented - (NSURLRequest *)connection:(NSURLConnection *)connection willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)response
which is called with the redirectRepsonse but connection:didReceiveData
is not called until the new redirected request returns.
I've found no solution so far except of using a CFNetwork based approach.
Update: I've created a sample project with the problem for you to play with: https://github.com/snod/302RedirectTest
Any ideas?