• 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
Re: NSURLConnection constantly redirecting
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSURLConnection constantly redirecting


  • Subject: Re: NSURLConnection constantly redirecting
  • From: Jesus De Meyer <email@hidden>
  • Date: Thu, 19 Apr 2007 13:09:11 +0200

Doesn't anyone have a solution for this?

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:
studios.com


This email sent to email@hidden

_______________________________________________

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


References: 
 >NSURLConnection constantly redirecting (From: Jesus De Meyer <email@hidden>)

  • Prev by Date: [Cocoa] How convert ":Developer:Private:jam" into a path POSIX-style
  • Next by Date: CG related warnings when loading Nib
  • Previous by thread: NSURLConnection constantly redirecting
  • Next by thread: Re: NSURLConnection constantly redirecting
  • Index(es):
    • Date
    • Thread