如何截取POST数据在Android的WebView [英] How to intercept POST data in an android webview
问题描述
我有一个Android应用程序,它由一个web视图中。它需要让用户填写网页上的表格,然后更改格式的数据的用户点击后提交
的形式。表单将使用POST请求方法。
I have an android app that consists of a webview. It needs to allow users to fill in a form on a webpage and then change the data of the form after the user has clicked submit
on the form. The form will use the POST request method.
我的问题是,我怎样才能从形式截取POST数据,改变它的值,然后沿着发吗?
例如:如果有一个Web表单像这样...
For example: If there's a web form like this...
<form action="http://www.example.com/do.php" method="post">
<input type="text" name="name" />
<input type="text" name="email" />
<input type="submit" />
</form>
如果用户输入名称=史蒂夫和电子邮件= steve@steve.com的形式,我想改变在Android应用程序中的值名称= Bob和电子邮件= bob@bob.com,并有新的职位是发送到 http://www.example.com/do.php
。
If the user enters name = Steve and email = steve@steve.com in the form, I want to change the values to name = bob and email = bob@bob.com in the android app and have the new POST be sent to http://www.example.com/do.php
.
感谢您的帮助!
推荐答案
如果你熟悉JavaScript,我建议你使用JavaScript。我认为这是更方便,更容易。 这巡演将告诉您如何使用JavaScript在web视图。
If you are familiar with JavaScript, I would suggest you use JavaScript. I think it's more convenient and easy. This tour tells you how to use JavaScript in a WebView.
这篇关于如何截取POST数据在Android的WebView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!