我正在开发一个需要通过 HTTPS 或 SSL 协议(protocol)连接到 IIS 服务器的 iPhone 项目。谁能告诉我如何在 iPhone 中实现 HTTPS 连接?任何建议将不胜感激。
提前致谢。
最佳答案
本·科普西的 ASIHTTPRequest
框架使得通过 SSL 发出 Web 请求变得轻而易举。
稍微修改站点的示例:
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 开发 : How to implement HTTPS connection?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2809363/