ProductPromotion
Logo

Kotlin

made by https://0x3d.site

GitHub - kittinunf/fuel: The easiest HTTP networking library for Kotlin/Android
The easiest HTTP networking library for Kotlin/Android - kittinunf/fuel
Visit Site

GitHub - kittinunf/fuel: The easiest HTTP networking library for Kotlin/Android

GitHub - kittinunf/fuel: The easiest HTTP networking library for Kotlin/Android

Fuel

Kotlin MavenCentral ktlint Run Gradle Push Codecov

The easiest HTTP networking library for Kotlin backed by Kotlinx Coroutines.

Migration

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.

Download

For release version

implementation("com.github.kittinunf.fuel:fuel:3.0.0-alpha04")

Quick Start

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)
}

Custom Configuration

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.

Requirements

  • If you are using Android, It needs to be Android 5+.
  • Java 8+

R8 / Proguard

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

Other libraries

If you like Fuel, you might also like other libraries of mine;

  • Result - The modelling for success/failure of operations in Kotlin
  • Fuse - A simple generic LRU memory/disk cache for Android written in Kotlin
  • Forge - Functional style JSON parsing written in Kotlin
  • ReactiveAndroid - Reactive events and properties with RxJava for Android SDK

Credits

Fuel brought to you by contributors.

Licenses

Fuel released under the MIT license.

More Resources
to explore the angular.

mail [email protected] to add your project or resources here 🔥.

Related Articles
to learn about angular.

FAQ's
to learn more about Angular JS.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory