ios NSURLConnection如何回发html表单而不创建带有标题和帖子值的新请求

时间:2013-04-28 07:27:18

标签: ios forms postback nsurlconnection nsurlrequest

我正在使用NSURLConnection向html网页发出请求。该页面返回一个包含许多(更改)隐藏字段的Web表单。

表单中有一个ok / cancel按钮,并在服务器上显示相关操作。

我的问题是,我如何请求表单,然后回复服务器模拟按下“确定”按钮而不分离网页表单并重新创建新的NSURLConnection请求

我想做的Psudo代码:

NSURLConnection *requestForm = [NSURLConnection NSURLConnectionWithString:@"http://mywebform.com"];

[requestForm doTheRequestAndGetTheWebPageBackWithFormThatIsInsideOfIt];

[requestFrom DoThePostBackSimulatingUserPressedOKButton];

1 个答案:

答案 0 :(得分:0)

使用UIWebView加载页面,并调用“stringByEvaluatingJavaScriptFromString:”来模拟按钮点击。