Authentication for NSURLConnection when not required

I am trying to download a file from google trend. I am using NSURLConnection to get a file.

I want to tell google that I am logged in (i.e. authenticating the connection) so that there are no upload restrictions. I tried using:

- (void)connection:(NSURLConnection *)connection willSendRequestForAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge

      

The problem is that no login is required , the method is never called. Is there a way to verify the authenticity of the connection? thank!

Note: I've asked this question before here , but I didn't get an answer, so I'm asking again - hope ok

EDIT: Perhaps I can use - (NSCachedURLResponse *)connection:(NSURLConnection *)connection willCacheResponse:(NSCachedURLResponse *)cachedResponse

? Is it possible to somehow authenticate through the cache?

+3


source to share


1 answer


you need to set the correct header fields NSURLRequest

. Take a look at the response of this post. You will have to look for base64 encoding.



0


source







All Articles