在 iPhone 上管理 HTTP Cookie [英] Managing HTTP Cookies on iPhone

查看:17
本文介绍了在 iPhone 上管理 HTTP Cookie的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为 iPhone 移植一个使用 mechanize 的 python 应用程序.此应用需要登录网页并使用站点 cookie 转到该站点上的其他页面以获取一些数据.

I want to port a python app that uses mechanize for the iPhone. This app needs to login to a webpage and using the site cookie to go to other pages on that site to get some data.

在我的 python 应用程序中,我使用 mechanize 进行自动 cookie 管理.可移植到 iPhone 的 Objective C 有类似的东西吗?

With my python app I was using mechanize for automatic cookie management. Is there something similar for Objective C that is portable to the iPhone?

感谢您的帮助.

推荐答案

NSURLConnection 为您提供免费的 cookie 管理.来自 URL 加载系统编程指南:

URL 加载系统会自动发送任何适合 NSURLRequest 的存储 cookie.除非请求指定不发送 cookie.同样,根据当前的 cookie 接受政策接受在 NSURLResponse 中返回的 cookie.

The URL loading system automatically sends any stored cookies appropriate for an NSURLRequest. unless the request specifies not to send cookies. Likewise, cookies returned in an NSURLResponse are accepted in accordance with the current cookie acceptance policy.

这篇关于在 iPhone 上管理 HTTP Cookie的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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