简体   繁体   中英

Httpclient in java without using any third party libraries

I trying to automate few things in my workplace where we are not allowed to use internet (Not all website very few allowed).

Req: I have a form which has a single text box & a single submit button, I have to put something in the text box and submit the form. The response I need to parse the HTML and get a specific text. The pages are written in JSP

Constraint: I don't have access to third party libraries & have to work with Java 6.

Please put me in right direction.

HttpURLConnection comes default with java. You may consider using this API. This API does most of the functionality as Apache HTTPClient. Here is simple example on how to use HTTPURLConnection .

我将使用来自Firefox的tamperdata之类的内容来捕获发送到服务器的HTTP请求,然后使用HTTPUrlConnection(JDK的一部分)重新创建该请求。

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