I am asking for any kind of feedback on the next version of Fuel that is based on OkHttp with a support of ktor. It is not backward compatibility. It requires Java 8+. If you want to use it on Android, it have to be Android 5+.
So far, there is one known issue on ktor is unsupported websockets.
If you really want to test it,
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'com.github.kittinunf.fuel:fuel:3.x-SNAPSHOT'
}
I would like to test this with our KTOR application. Easier said than done because everything has changed and the changes are really major and only very thing documentation exists.
Due to this being such a major refactoring I at least would like to see some kind of migration guide. Or just a little bit more documentation how does the new API work.
I have so many questions by just trying to set up the environment to our old project.
fuel-coroutine package is gone? Is it now in the core?
fuel-jackson package is gone? is it now in the core? or part of OKHTTP?
How to replace FuelManager?
How to handle async request with the new API?
How to create an instance from Fuel with custom OKHttp configuration?
Here's few things that popped in to my mind by just trying replace the 2.x with 3.x.
It is really coroutine-based HTTP Client with fully async.
I can add jackson back.
val client = OkHttpClient.Builder()
.addNetworkInterceptor {
val originalResponse = it.proceed(it.request())
originalResponse.newBuilder()
.body(ProgressResponseBody(originalResponse.body!!, progressListener))
.build()
}.build()
val httpLoader = HttpLoader.Builder().okHttpClient(client).build()
If you want to add custom OkHttp configuration for it
on Android, you can use the HttpLoaderFactory on the Application class to simplified the singleton.
Jackson is now added to the 3.x branch.
Let's move our development effort to 3.x!