开发者

How to enable cookies when POSTING with URLConnection in iPhone SDK?

I am trying to do a POST towards a site which utilizes secure session with cookies. Ofcourse this won't work with the code I have posted below. It keeps responding with a non-authorized message.

Is there any way I can use cookies in my code or at least simulate cookie usage?

开发者_Python百科    NSURL *url = [[NSURL alloc] initWithString:@"https://long_and_complicated_url"];
 NSURLRequest *request = [[NSURLRequest alloc] initWithURL: url]; 
 NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self];

Best regards //Abeansits


The SDK has cookie support in the form of NSHTTPCookie and NSHTTPCookieStorage

Have you familiarized yourself with these?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜