iPhone开发:如何实现HTTPS连接? [英] iPhone development: How to implement HTTPS connection?

查看:88
本文介绍了iPhone开发:如何实现HTTPS连接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个需要通过HTTPS或SSL协议连接到IIS服务器的iPhone项目。谁能告诉我如何在iPhone中实现HTTPS连接?任何建议都会很感激。

I am working on an iPhone project which need to connect to the IIS server over HTTPS or SSL protocol. Can anyone tell me how to implement HTTPS connection in iPhone? Any advice would be appreciate.

提前谢谢你。

推荐答案

Ben Copsey的 ASIHTTPRequest 框架使通过SSL发出Web请求变得非常容易。

Ben Copsey's ASIHTTPRequest framework makes it trivially easy to issue web requests over SSL.

稍微修改网站示例:

NSURL *url = [NSURL URLWithString:@"https://allseeing-i.com"];
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
[request startSynchronous];
NSError *error = [request error];
if (!error) {
    NSString *response = [request responseString];
    NSLog (@"%@", response);
}

这篇关于iPhone开发:如何实现HTTPS连接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆