Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSURLConnection nil result (only on 10.4)



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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.