【发布时间】:2011-01-21 19:18:50
【问题描述】:
NSURL *url = [NSURL URLWithString:@"http://ip/login"];
NSMutableURLRequest *request = [[NSMutableURLRequest alloc]initWithURL: url];
NSString *body = [NSString stringWithFormat: @"name=%@&pass=%@", @"phpxiaoxin", @"86f7e437faa5a7fce15d1ddcb9eaeaea377667b8"];
[request setHTTPBody: [body dataUsingEncoding: NSUTF8StringEncoding]];
[request setHTTPMethod: @"POST"];
//Load the request in the UIWebView.
[webView loadRequest:request];
url = [NSURL URLWithString:@"http://ip/hotel/hotelReservationList.action"];
request = [[NSMutableURLRequest alloc]initWithURL: url];
[webView loadRequest:request];
大家好,我对 uiwebview 会话原因有疑问; 现在首先我想使用 postmethod 登录系统 然后我需要控制重定向到“hotelreservation.action”的动作 但是第二个请求没有扩展第一个会话,所以结果是 Web 系统重定向到登录页面 我应该用 uiwebview 做什么,我知道我可以在 web 中重定向,但我确实需要通过 webview 控制。 所以有人可以帮助我吗?非常感谢
【问题讨论】:
标签: iphone session uiwebview cookies webview