get image from https url+iphone
i want to get the image from https url in iphone:- The url is like this:-
https://staging.api.botentekoop.nl/image.ashx?ID=804306&imagesize=Normal&imagetype=MainImage
i had done some google work and found the help from this link:- http://www.iphonedevsdk.com/forum/iphone-sdk-development/开发者_运维百科5511-load-image-internet.html http://www.iphonedevsdk.com/forum/iphone-sdk-development/80894-load-image-url.html
But there all example is shown for http not from https
CAn anyone help me. please how to do this
The URL Loading System on iOS works the same for HTTP and HTTPS URLs. Any example you find that works for an HTTP URL should also work for HTTPS.
you can use ASIHTTPRequest framework
thanks for the reply...... i got the solution. i had done in this way:-
NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:strURL] cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:30.0];
[NSURLRequest setAllowsAnyHTTPSCertificate:YES forHost:[[NSURL URLWithString:strURL] host]];
// [theRequest addValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
// [theRequest setHTTPMethod:@"GET"];
NSURLConnection *theConnection = [[[NSURLConnection alloc] initWithRequest:theRequest delegate:self] autorelease];
if(theConnection) {
self.activeDownload = [[NSMutableData data] retain];
}
else {
NSLog(@"theConnection is NULL");
}
精彩评论