README

mavenCentralarrow-up-right Build Statusarrow-up-right Codecovarrow-up-right

The easiest HTTP networking library for Kotlin/Android.

You are looking at the documentation for 2.x.y.. If you are looking for the documentation for 1.x.y, checkout the 1.16.0 README.mdarrow-up-right

Features

Installation

We offer maven and jitpack installations. Maven via bintray only has stable releases but jitpack can be used to build any branch, commit and version.

Maven

You can downloadarrow-up-right and install Fuel with Maven and Gradle. The core package has the following dependencies:

Make sure to include mavenCentral() in your repositories (jcenter() is deprecated, new releases starting from 2.2.3 are hosted on mavenCentral())

Each of the extensions / integrations has to be installed separately.

Package
Description

Core package

Android: Automatically invoke handler on Main Thread when using Android Module

(De)serialization: Gsonarrow-up-right

Android Architectures: Responses as LiveDataarrow-up-right

Reactive Programming: Responses as Monoarrow-up-right (Project Reactor 3.x)

Reactive Programming: Responses as Singlearrow-up-right (RxJava 2.x)

Utility: Debug utility for Android on Chrome Developer Tools, Stethoarrow-up-right

Jitpack

If you want a SNAPSHOT distribution, you can use Jitpackarrow-up-right

or

Configuration

  • group is made up of com.github as well as username and project name

  • name is the subproject, this may be any of the packages listed in the installation instructionsarrow-up-right eg. fuel, fuel-coroutines, fuel-kotlinx-serialization, etc

  • version can be the latest master-SMAPSHOT or -SNAPSHOT which always points at the HEAD or any other branch, tag or commit hash, e.g. as listed on jitpack.ioarrow-up-right.

We recommend not using SNAPSHOT builds, but a specific commit in a specific branch (like a commit on master), because your build will then be stable.

Build time-out

Have patience when updating the version of fuel or building for the first time as jitpack will build it, and this may cause the request to jitpack to time out. Wait a few minutes and try again (or check the status on jitpack).

NOTE: do not forget to add the kotlinx repository when using coroutines or serialization

Forks

Jitpack.io also allows to build from fuel forks. If a fork's username is $yourname,

  • adjust group to com.github.$yourName.fuel

  • and look for version on https://jitpack.io/#$yourName/Fuel

Quick start

Fuel requests can be made on the Fuel namespace object, any FuelManager or using one of the String extension methods. If you specify a callback the call is async, if you don't it's blocking.

Async Usage Example

Blocking Usage Example

Fuel and the extension methods use the FuelManager.instance under the hood. You can use this FuelManager to change the default behaviour of all requests:

Detailed usage

Check each of the packages documentations or the Wiki for more features, usages and examples. Are you looking for basic usage on how to set headers, authentication, request bodies and more? fuel: Basic usage is all you need.

Basic functionality

Responses

(De)serialization

Utility

Other libraries

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

Credits

Fuel is brought to you by contributorsarrow-up-right.

Licenses

Fuel is released under the MITarrow-up-right license.

Last updated

Was this helpful?