UIWebView + cookie

来源:互联网 发布:ecshop京东商城源码 编辑:程序博客网 时间:2024/05/15 07:55
    UIWebView *webView = [[UIWebView alloc] init];    webView.scrollView.contentInset = UIEdgeInsetsMake(-20, 0, 0, 0);    webView.frame = self.view.bounds;    [self.view addSubview:webView];    webView.scalesPageToFit = YES;        NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:currentURL]];    NSArray *cookies = [[ASUtils sharedInstance] getCurCookie];    NSDictionary *headers = [NSHTTPCookie requestHeaderFieldsWithCookies:cookies];    [request setValue:[headers objectForKey:@"Cookie"] forHTTPHeaderField:@"Cookie"];    [webView loadRequest:request];

0 0