This repository has been archived by the owner on Oct 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
GroundWork FoxHttp QuickStart
Patrick Bösch edited this page Feb 20, 2017
·
8 revisions
<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));
Coming Soon