Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
947 views
in Technique[技术] by (71.8m points)

http - How to intercept POST data in an android webview

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.

So my question is, how can I intercept the POST data from the form, change it's values, then send it along?

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>

If the user enters name = Steve and email = [email protected] in the form, I want to change the values to name = bob and email = [email protected] in the android app and have the new POST be sent to http://www.example.com/do.php.

Thanks for your help!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...