webView post 请求

来源:互联网 发布:seo基础理论 编辑:程序博客网 时间:2024/06/07 13:01
NSURL *url = [NSURL URLWithString: @"需要填写自己的URL"];NSString *body = [NSString stringWithFormat: @"arg1=%@&arg2=%@", @"val1",@"val2"]; NSMutableURLRequest *request = [[NSMutableURLRequest alloc]initWithURL: url];[request setHTTPMethod: @"POST"];[request setHTTPBody: [body dataUsingEncoding: NSUTF8StringEncoding]];[webView loadRequest: request];
原创粉丝点击