【问题标题】:uiwebview session problemuiwebview 会话问题
【发布时间】: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


    【解决方案1】:

    您应该在UIWebViewDelegatewebViewDidFinishLoad: 方法中执行第二个请求。

    【讨论】:

      猜你喜欢
      • 2013-02-04
      • 2010-12-19
      • 1970-01-01
      • 2010-11-05
      • 1970-01-01
      • 2012-02-10
      • 2010-12-26
      • 2012-08-28
      • 2010-11-24
      相关资源
      最近更新 更多