UIWebView 传参数给链接的页面有两种方式:
①. get请求: 直接在链接后面拼接参数.
url = [[ NSURL alloc] initWithString:@"http://www.*****.com/index.php?param1=a¶m2=b¶m3=c"];
[WebView loadRequest:[ NSURLRequest requestWithURL: url ]];
②. post请求: 这种方式更安全一些.
NSURL *url = [NSURL URLWithString: @"http://www.*****.com/index.php?param1=a"];
NSString *body = [NSString stringWithFormat: @"param2=%@¶m3=%@",@"b",@"c"];
NSMutableURLRequest *request = [[NSMutableURLRequest alloc]initWithURL: url];
[request setHTTPMethod: @"POST"];
[request setHTTPBody: [body dataUsingEncoding: NSUTF8StringEncoding]];
[WebView loadRequest: request];