• 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 nil result (only on 10.4)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSURLConnection nil result (only on 10.4)


  • Subject: NSURLConnection nil result (only on 10.4)
  • From: "dexter morgan" <email@hidden>
  • Date: Sun, 31 Aug 2008 12:27:15 +0200

Hello List,
I'm using NSURLConnection/NSURLRequest in order to download some pages
from the web.
My app should be compatible both with 10.4 and 10.5.
However I've noticed a strange behavior only on 10.4: the method -
(void)connection:(NSURLConnection *)connection didReceiveData:(NSData
*)data {
never called and my _receivedData object still empty.
The result on - (void)connectionDidFinishLoading:(NSURLConnection
*)connection  method is a nil content.

The code is:

	_request = [[NSMutableURLRequest alloc] initWithURL: _url];
	[_request setHTTPMethod: @"POST"];
	[_request setHTTPShouldHandleCookies: YES];

	// setup user agent (standard mode or custom)
	[_request setValue: ([_options objectForKey: @"CURLOPT_USERAGENT"] == nil ?
						 STEALTH_USERAGENT :
						 [_options objectForKey: @"CURLOPT_USERAGENT"])
		forHTTPHeaderField:@"User-Agent"];

	// init session data container
	[_receivedData release];
	_receivedData= [[NSMutableData alloc] init];

	// create a new connection
	[_connection release];
	_connection = [[[NSURLConnection alloc] initWithRequest: _request
delegate: self] retain];

All works fine on 10.5.
I've also noticed that this error happends only for certain address.
For example this works fine:
http://www.tim.it/consumer/homepage.do

while these not:
https://www.190.it/190/trilogy/jsp/login.do
http://www.tele2internet.it/clogin.phtml
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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 nil result (only on 10.4)
      • From: "dexter morgan" <email@hidden>
  • Prev by Date: accessing netinfo db from cocoa?
  • Next by Date: Re: NSURLConnection nil result (only on 10.4)
  • Previous by thread: Re: accessing netinfo db from cocoa?
  • Next by thread: Re: NSURLConnection nil result (only on 10.4)
  • Index(es):
    • Date
    • Thread