UIWebView帶Post請求地址,如果使用Get方式的話,請求的參數直接拼接在Url裏面就好。如果是Post方式就需要放在Body裏面
NSURL *url = [NSURL URLWithString: @"www.baidu.com"];
NSString *body = [NSString stringWithFormat: @"arg1=%@&arg2=%@", @"val1",@"val2"];
NSMutableURLRequest *request = [[NSMutableURLRequest alloc]initWithURL: url];
[request setHTTPMethod: @"POST"];
[request setHTTPBody: [body dataUsingEncoding: NSUTF8StringEncoding]];
[self.webView loadRequest: request];