• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSURLConnection constantly redirecting
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSURLConnection constantly redirecting


  • Subject: NSURLConnection constantly redirecting
  • From: Jesus De Meyer <email@hidden>
  • Date: Wed, 18 Apr 2007 21:19:57 +0200

Hi again,

For certain sites the delegate method for NSURLConnection constantly receives redirection calls. It never stops even after data has been received and the object has been released.

This is what I do when I get a redirect call:

- (NSURLRequest*)connection:(NSURLConnection*)aURLConnection willSendRequest:(NSURLRequest *)request redirectResponse: (NSURLResponse *)redirectResponse {
return request;
}


and the way the NSURLConnection is made:

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL: [self URL]
cachePolicy:NSURLRequestReloadIgnoringCacheData
timeoutInterval:60.0];

NSString *versionNumber = (NSString*) CFBundleGetValueForInfoDictionaryKey(CFBundleGetMainBundle(), (CFStringRef)@"CFBundleVersion");

[request addValue:[NSString stringWithFormat:@"My App/%@", [request setHTTPShouldHandleCookies:NO];

if (receivedData) { [receivedData release]; receivedData = nil; }
receivedData = [[NSMutableData data] retain];

if (connection) { [connection release]; connection = nil; }
connection = [[NSURLConnection connectionWithRequest:request delegate:self] retain];

if (connection == nil) {
NSLog(@"error NSURLConnection");
}


Thanks in advance,

Jesus


__________________ Jesus De Meyer www.edot-studios.com jesus.edot-studios.com "creativity in mind"


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSURLConnection constantly redirecting
      • From: Keary Suska <email@hidden>
    • Re: NSURLConnection constantly redirecting
      • From: Jesus De Meyer <email@hidden>
  • Prev by Date: Re: Drawing with NSBezierPath
  • Next by Date: ObscureCursor?
  • Previous by thread: Re: Drawing with NSBezierPath
  • Next by thread: Re: NSURLConnection constantly redirecting
  • Index(es):
    • Date
    • Thread