我正在使用NSURLConnection向html网页发出请求。该页面返回一个包含许多(更改)隐藏字段的Web表单。
表单中有一个ok / cancel按钮,并在服务器上显示相关操作。
我的问题是,我如何请求表单,然后回复服务器模拟按下“确定”按钮而不分离网页表单并重新创建新的NSURLConnection请求
我想做的Psudo代码:
NSURLConnection *requestForm = [NSURLConnection NSURLConnectionWithString:@"http://mywebform.com"];
[requestForm doTheRequestAndGetTheWebPageBackWithFormThatIsInsideOfIt];
[requestFrom DoThePostBackSimulatingUserPressedOKButton];
答案 0 :(得分:0)
使用UIWebView加载页面,并调用“stringByEvaluatingJavaScriptFromString:”来模拟按钮点击。