简体   繁体   English

从https url + iphone获取图像

[英]get image from https url+iphone

i want to get the image from https url in iphone:- The url is like this:- 我想从iPhone中的https网址获取图像:-网址是这样的:-

https://staging.api.botentekoop.nl/image.ashx?ID=804306&imagesize=Normal&imagetype=MainImage 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 我做了一些谷歌的工作,发现从这个链接帮助: - 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 但是这里显示了所有示例,而不是来自https的http

CAn anyone help me. 谁能帮我。 please how to do this 请怎么做

The URL Loading System on iOS works the same for HTTP and HTTPS URLs. iOS上的URL加载系统适用于HTTP和HTTPS URL。 Any example you find that works for an HTTP URL should also work for HTTPS. 您发现适用于HTTP URL的任何示例也适用于HTTPS。

您可以使用ASIHTTPRequest框架

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");
    }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM