A light-weight library that bring a Fetch-like API to Java.
View Javadocs »
Report Bug
·
Request Feature
Notice:
Fetch4J is now feature-complete. New features will only be added upon request. Bug fixes and maintenance will still be provided.
<dependency>
<groupId>net.insprill</groupId>
<artifactId>fetch4j</artifactId>
<version>version</version>
</dependency>
dependencies {
implementation 'net.insprill:fetch4j:version'
}
dependencies {
implementation("net.insprill:fetch4j:version")
}
import static net.insprill.fetch4j.Fetch.fetch;
String body = fetch("https://example.com/").getBody();
import static net.insprill.fetch4j.Fetch.fetch;
import static net.insprill.fetch4j.Params.params;
Response response = fetch("https://example.com/api/paste", params()
.method(Method.POST)
.contentType(ContentType.TEXT)
.body("Howdy"));
Fetch4J supports many parameters to customize requests. For all that are available, check out the Javadocs.
To compile Fetch4J, you will need JDK 8 or higher and an internet connection.
Clone this repo, then run ./gradlew build
from your terminal.
You can find the compiled jar in the build/libs
directory.
If you wish to install it to your local Maven repository, run ./gradlew publishToMavenLocal
.
Contributions are what make the open source community such an amazing place to learn, inspire, and create.
Any contributions you make are greatly appreciated!
If you're new to contributing to open-source projects, you can follow this guide.
Distributed under the Apache 2.0 License. See LICENSE for more information.