GroundWork FoxHttp QuickStart - viascom/FoxHttp GitHub Wiki
<dependency>
<groupId>ch.viascom.groundwork</groupId>
<artifactId>foxhttp</artifactId>
<version>1.1</version>
</dependency>
compile 'ch.viascom.groundwork:foxhttp:1.1'
If you use FoxHttp in android make sure you have the jack option enabled. This is needed, because FoxHttp uses Java 8.
android {
...
defaultConfig {
...
jackOptions {
enabled true
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
If you are using proguard you have to add this to your proguard-rules.pro file:
-keep class ch.viascom.groundwork.** {
*;
}
FoxHttpResponse foxHttpResponse = new FoxHttpRequestBuilder("http://httpbin.org/get").build().execute();
System.out.println(foxHttpResponse.toString(true));
FoxHttpResponse foxHttpResponse = new FoxHttpRequestBuilder("http://httpbin.org/post", RequestType.POST)
.setRequestBody(new RequestStringBody("Request-Body", ContentType.DEFAULT_TEXT))
.build()
.execute();
System.out.println(foxHttpResponse.toString(true));