我用UIWebView加载出来了,但是换成WKWebView就加载失败,错误原因是post请求的参数没传过去。
UIWebView的加载代码是这样的
UIWebView *webView = [[UIWebView alloc] init];
NSString *bodyShare = [NSString stringWithFormat: @"hID=%@", userID];
NSMutableURLRequest * requestShare = [[NSMutableURLRequest alloc]initWithURL:[NSURL URLWithString:self.urlStr]];
[requestShare setHTTPMethod: @"POST"];
[requestShare setHTTPBody: [bodyShare dataUsingEncoding: NSUTF8StringEncoding]];
[webView loadRequest:requestShare];
换成WKWebView就加载不出来了,请教下各位,怎么样用WKWebView加载POST请求。
Are you sure you addSubView?
According to the above code, the request should be sent normally.
Can you provide a demo of the error?
http://www.jianshu.com/p/4038...
My question is, blogger, have you solved this problem? If you solve it, please let me know