简体   繁体   中英

How to post data to html form via java?

I have this html form

<form enctype="multipart/form-data" action="upload.php" method="POST">
        <textarea rows="5" cols="50" name="links" id="links" style="margin-left: 2px; margin-right: 2px; width: 428px; margin-top: 2px; margin-bottom: 2px; height: 149px; "></textarea>
        <input type="hidden" name="uploadtype" value="links">
        <br>
        <button type="submit" name="submit"></button>
        </form>

How to write some data in the text area and click the submit button using java?

You can try apache http client Http Client

And try latest "version" HttpClient

Example

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM