Code Monkey home page Code Monkey logo

fuel's Introduction

Fuel

Kotlin MavenCentral ktlint Run Gradle 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-alpha1")

Quick Start

use the any http method suspend function:

runBlocking {
    val string = Fuel.get("https://publicobject.com/helloworld.txt").body!!.string()
    println(string)
}

runBlocking {
    val string = "https://publicobject.com/helloworld.txt".httpGet().body!!.string()
    println(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.

fuel's People

Contributors

inoles avatar kittinunf avatar

Stargazers

reed richards avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.