UIWebView加载POST请求

UIWebView加载POST请求

NSURL*url=[NSURLURLWithString:@"http://your_url.com"];

NSString*body=[NSStringstringWithFormat:@"arg1=%@&arg2=%@",@"val1",@"val2"];NSMutableURLRequest*request=[[NSMutableURLRequestalloc]initWithURL:url];

[request setHTTPMethod:@"POST"];

[request setHTTPBody:[body dataUsingEncoding:NSUTF8StringEncoding]];

[webView loadRequest:request];

你可能感兴趣的:(UIWebView加载POST请求)