webview post,get请求

        NSURL *url = [NSURL URLWithString:];
        NSString *body = [NSString stringWithFormat: @"uid=%@",];
        NSMutableURLRequest *request = [[NSMutableURLRequest alloc]initWithURL: url];
        
        [request setHTTPMethod: @"POST"];
        [request setHTTPBody: [body dataUsingEncoding: NSUTF8StringEncoding]];
        UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 64, HOME_SCREEN_WIDTH, HOME_SCREEN_HEIGHT - 64)];
        [webView loadRequest:request];
        [_playView addSubview:webView];
get
url = [[ NSURL alloc] initWithString:@"http://www.********.com.cn:8081/index.php/Account/[email protected]&password=1&amount=12"];
[WebView  loadRequest:[ NSURLRequest requestWithURL: url ]]; //习惯采用loadRequest方式,你可采用其他方式

你可能感兴趣的:(webview post,get请求)