简体   繁体   English

Java中的HttpClient而不使用任何第三方库

[英]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. 我需要解析HTML并获取特定文本的响应。 The pages are written in JSP 这些页面是用JSP编写的

Constraint: I don't have access to third party libraries & have to work with Java 6. 约束:我无权访问第三方库并且必须使用Java 6。

Please put me in right direction. 请把我朝正确的方向。

HttpURLConnection comes default with java. HttpURLConnection是Java的默认值。 You may consider using this API. 您可以考虑使用此API。 This API does most of the functionality as Apache HTTPClient. 该API像Apache HTTPClient一样执行大多数功能。 Here is simple example on how to use HTTPURLConnection . 这是有关如何使用HTTPURLConnection的简单示例

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 有没有不用第三方库就可以创建tar文件的方法? - Is there any way to create tar file without using third party libraries? 如何在不使用第三方库的情况下转义java字符串中的unicode字符 - How to escape unicode characters in a java string without using third party libraries 如何在不使用第三方库的情况下使 recyclerview 可扩展 - How to make recyclerview Expandable without using third party libraries 使用带有netbeans的第三方库 - Using third party libraries with netbeans 如何在没有 jsoup 或任何其他第三方的情况下在 java 上读取 html? - How to read html on java without jsoup or any other third party? 如何将第三方Java库添加到Java - How to add third party java libraries to java Java-依赖注入-第三方库 - Java - Dependency Injection - third party libraries Java-是否有其他备用第三方Collections(ArrayList等)库? - Java - Is there any alternative, third-party Collections (ArrayList, etc.) libraries? 在OSGi环境中使用第三方JavaFX库 - Using third party JavaFX libraries in OSGi enviroment 如何从 java 中的 class object 列表中获取第一个匹配元素的索引(不使用任何第三方库) - How to get index of first matched element from the list of class object in java (Without using any third party Library)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM