The easiest HTTP networking library for Kotlin/Android
See the codeThe easiest HTTP networking library for Kotlin backed by Kotlinx Coroutines.
From 3.x onwards, we are using main as our new base branch. If you are finding the old version 2.x, please take a look at our old branch.
implementation("com.github.kittinunf.fuel:fuel:3.0.0-alpha04")
use the any http method suspend function:
runBlocking {
val string: String = Fuel.get("https://publicobject.com/helloworld.txt").body.string()
println(string)
}
runBlocking {
val string: String = "https://publicobject.com/helloworld.txt".httpGet().body.string()
println(string)
}
runBlocking {
val fuel = FuelBuilder().build()
val string: String = fuel.get(request = { url = "https://publicobject.com/helloworld.txt" }).body.string()
println(string)
}
JVM uses OkHttpClient configurations
val fuel = FuelBuilder().config(OKHttpClient()).build()
val string = fuel.get(request = { url = "https://publicobject.com/helloworld.txt" }).body.string()
Apple uses NSURLSessionConfiguration
val fuel = FuelBuilder().config(NSURLSessionConfiguration.defaultSessionConfiguration).build()
val string = fuel.get(request = { url = "https://publicobject.com/helloworld.txt" }).body.string()
Please note it will throw Exceptions. Make sure you catch it on the production apps.
Fuel requires Java 8 byte code.
Fuel is fully compatible with R8 out of the box and doesn't require adding any extra rules.
If you use Proguard, you may need to add rules for Coroutines, OkHttp and Okio.
If you use the fuel-serialization modules, you may need to add rules for Serialization.
If you use the fuel-moshi modules, you may need to add rules for Moshi and Moshi-Kotlin
If you like Fuel, you might also like other libraries of mine;
Fuel brought to you by contributors.
Fuel released under the MIT license.
Overall
Maintained
Latest release
Releases this year
1,228 followers · starred Jun 2016
236 followers · starred Dec 2018
1,037 followers · starred May 2017
415 followers · starred Aug 2017
The easiest HTTP networking library for Kotlin/Android
See the codeThe easiest HTTP networking library for Kotlin backed by Kotlinx Coroutines.
From 3.x onwards, we are using main as our new base branch. If you are finding the old version 2.x, please take a look at our old branch.
implementation("com.github.kittinunf.fuel:fuel:3.0.0-alpha04")
use the any http method suspend function:
runBlocking {
val string: String = Fuel.get("https://publicobject.com/helloworld.txt").body.string()
println(string)
}
runBlocking {
val string: String = "https://publicobject.com/helloworld.txt".httpGet().body.string()
println(string)
}
runBlocking {
val fuel = FuelBuilder().build()
val string: String = fuel.get(request = { url = "https://publicobject.com/helloworld.txt" }).body.string()
println(string)
}
JVM uses OkHttpClient configurations
val fuel = FuelBuilder().config(OKHttpClient()).build()
val string = fuel.get(request = { url = "https://publicobject.com/helloworld.txt" }).body.string()
Apple uses NSURLSessionConfiguration
val fuel = FuelBuilder().config(NSURLSessionConfiguration.defaultSessionConfiguration).build()
val string = fuel.get(request = { url = "https://publicobject.com/helloworld.txt" }).body.string()
Please note it will throw Exceptions. Make sure you catch it on the production apps.
Fuel requires Java 8 byte code.
Fuel is fully compatible with R8 out of the box and doesn't require adding any extra rules.
If you use Proguard, you may need to add rules for Coroutines, OkHttp and Okio.
If you use the fuel-serialization modules, you may need to add rules for Serialization.
If you use the fuel-moshi modules, you may need to add rules for Moshi and Moshi-Kotlin
If you like Fuel, you might also like other libraries of mine;
Fuel brought to you by contributors.
Fuel released under the MIT license.
Overall
Maintained
Latest release
Releases this year
1,228 followers · starred Jun 2016
236 followers · starred Dec 2018
1,037 followers · starred May 2017
415 followers · starred Aug 2017