Konloch Software

HTTP Request

Published 02/20/2023 Updated 02/26/2023

HTTP Request is an easy-to-use zero dependency Java wrapper to read from a URL.

What Does It Do?

  • Small Java Library that provides an API for reading from URLs.
    • Proxies
    • User Agent
    • Cookies
    • Post Data

Links

Requirements

  • Java 8 or greater

How To Integrate as a Dependency

Add the following to your pom.xml as a maven dependency, or just download the latest release and import it with your IDE.

<dependency>
  <groupId>com.konloch</groupId>
  <artifactId>HTTPRequest</artifactId>
  <version>2.2.0</version>
</dependency>

How To Use (Simple Request)

HTTPRequest request = new HTTPRequest(new URL("https://google.com/"));

ArrayList<String> webpage = request.read();

for(String line : webpage)
    System.out.println(line);

How To Use (Complex Request)

HTTPRequest request = new HTTPRequest(new URL("https://google.com/"));
request.setTimeout(10000);
request.setPostData("postdata=yes&awesome=yup");
request.setReferer("http://google.com/");
request.setCookie("cookies=yes;cool=sure");
request.setProxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress("127.0.0.1", 81)));

ArrayList<String> webpage = request.read();
for(String line : webpage)
    System.out.println(line);

for (Map.Entry<String, List<String>> k : request.getLastConnectionHeaders())
    System.out.println("Header Value:" + k.toString());

Latest Updates

HTTP Request v2.2.0

This is the third public release of the library, it has been heavily tested but please feel free to report any issues found.

To add it as a…

Read More

HTTP Request v2.1.0

This is the second public release of the library, it has been heavily tested but please feel free to report any issues found.

To add it as a…

Read More

HTTP Request v2.0.0

This is the first public release of the library, it has been heavily tested but please feel free to report any issues found.

To add it as a…

Read More