objective c - NSURLRequest / NSURLConnection ios 5.0 v/s earlier versions -
I am trying to use the NSMutableRequest and NSURL connection to bring the compressed file to the server. Here the code I am using is:
NSMutableURLRequest * newRequest = [NSMutableURLRequest requestWithURL: downloadUrl cachePolicy: NSURLRequestReloadIgnoringCacheData timeoutInterval: 30.0]; [NewRequest set value: @ "Y29tLm5vbWFkZ ......" forHTTPHeaderField: @ "Authority"]; NSURLConnection * connection = [request with NSURL connection connection: newRequest representative: self]; If (! Connection) {[download manually]; } and I use the same NSURLConnectionDelegate method didReceiveResponse, didReceiveData, connectionDidFinishLoading, didFailWithError but
When I run this code in iOS 4.3 or earlier, I get different responses (it downloads the zipped file) and iOS 5.0 (JSON says "authentication failed."). IOS 5.0 has introduced many new methods for NSURLConnectionDelegate but I'm not sure that this is an issue about the converted API for iOS 5.0 or it is a server code that is different from different ways The request is handling. Does anyone know what the problem might be?
iOS 5 has capitalized the HTML header You receive real HTTP header by printing:
- (zero) connection: (NSURLConnection *) aConnection didReceiveResponse: (NSURLResponse *) aResponse {NSHTTPURLResponse * HttpResponse = (NSHTTPURLResponse *) A response; NSLog (@ "Response Header:% @", [HHS Spawns Allheardfield]); } BTW has notices to you that those methods are marked as "in Ash" "Available in iOS 4.3 with iOS 2.0" ?
Comments
Post a Comment