Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
955 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 = 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.

Thanks for your help!

See Question&Answers more detail:os

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

1 Reply

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...