https://kotlinlang.org logo
Join SlackCommunities
Powered by
# kotlin-fuel
  • r

    Robert Jaros

    08/25/2020, 2:40 PM
    Does Fuel 2.2.3 work with Kotlin 1.4.0?
  • n

    Nikky

    08/25/2020, 2:44 PM
    fuel itself might.. anything that is coroutine or serialization related most likely will break
  • k

    kittinunf

    08/26/2020, 1:50 AM
    Nope, i will update to Kotlin 1.4 on the next version
    鉁旓笍 1
  • i

    itnoles

    09/11/2020, 11:43 PM
    Should I enable explicit api mode on 3.x?
  • n

    Nikky

    09/13/2020, 3:51 PM
    i think that would be good
    i
    k
    • 3
    • 5
  • k

    kittinunf

    09/14/2020, 3:40 AM
    btw, can someone check on the 1.4 PR? after that is merged, we can release new version
  • k

    kittinunf

    09/14/2020, 3:40 AM
    then I think we can start phasing out version 2.x then move over the new implementation to version 3.x and use @itnoles鈥檚 awesome implementation as a base for future development
    馃憤 1
    鉂わ笍 2
  • y

    Yamila Gammeri

    09/21/2020, 10:47 AM
    1. I have an endpoint where server side validation occurs, currently I am serialising the response using聽
    networkService.fuelManager.request(BTXInteractApi.GetLegal()).awaitObjectResult<LegalModel>(kotlinxDeserializerOf(json = networkService.json()))
    , I was wondering how I could check the HTTP status code and then decode the response into another model based on this. 2. The API I鈥檓 using requires the use of an access token + refresh token, is it possible to configure fuel such that I can intercept a failed auth request and then update the session using the access token? E.g.聽 a request is made, server responds with 401, another request is made to refresh session, original request is sent again, response is received
  • b

    Brett Best

    09/24/2020, 5:46 AM
    Hey @kittinunf is it possible to call async functions in an response interceptor?
    d
    • 2
    • 2
  • l

    LeoColman

    10/27/2020, 7:34 PM
    Hi! Is it possible to ignore the
    request, response, result
    stuff and go directly to the result part?
    a
    • 2
    • 1
  • l

    LeoColman

    10/27/2020, 7:34 PM
    "x".httpGet().responseString()
    and get it as a string
  • l

    LeoColman

    10/27/2020, 7:34 PM
    Or something like that
  • l

    LeoColman

    10/27/2020, 7:34 PM
    I usually don't use the other parameters, and it's a little bit boilerplatey
  • k

    kittinunf

    10/28/2020, 10:49 AM
    you can try
    .responseString().third
  • n

    Ncrnomarkovic

    11/24/2020, 7:17 PM
    1st time using Fuel to make an http request and parse it into an object using the following tutorial:聽https://medium.com/@paul.allies/kotlin-http-get-with-deserialization-with-fuel-12691904e30b I don't understand the part about Gson. Looks like I don't have it defined in my gradle. Is this article's implementation the way to go? Is Fuel a good networking and parsing library? Advice appreciated - thank you
    Untitled
    鈽濓笍 1
    t
    k
    n
    • 4
    • 6
  • a

    Arkangel

    12/13/2020, 3:35 PM
    Hey guys what鈥檚 the easiest way to add an auth interceptor to Fuel using the variable from a post body in ktor
  • a

    Arkangel

    12/13/2020, 3:35 PM
    ..tried something like this
  • a

    Arkangel

    12/13/2020, 3:35 PM
    Copy code
    FuelManager.instance.addRequestInterceptor(tokenInterceptor())
    fun tokenInterceptor() = {
        next: (Request) -> Request ->
        { req: Request ->
            req.header(mapOf("Authorization" to "Bearer AbCdEf123456"))
            next(req)
        }
    }
  • a

    Arkangel

    12/13/2020, 3:36 PM
    and it didn鈥檛 work as the fuel request is executed before the interceptor is set up
  • a

    Arkangel

    12/13/2020, 3:36 PM
    and wrapping it in a runBlocking function didn鈥檛 help either .. it鈥檚 not executed in the right order
  • a

    Arkangel

    12/13/2020, 3:36 PM
    ..thnaks
  • p

    pgreze

    02/04/2021, 6:51 AM
    Hi @kittinunf , I need your help about an
    OutOfMemoryError: Java heap space
    I鈥檓 facing. I鈥檓 trying to download a file and write its content in a file like that:
    Copy code
    val result = location.httpGet().response()
    destination.writeBytes(result.third.get())
    Is there some built-in helper in order to help avoiding memory issues? thx in advance 馃檹
    k
    • 2
    • 5
  • e

    Emil Kantis

    02/04/2021, 8:18 AM
    Does anyone have recommendations on testing code that depends on Fuel? E.g. I have a client that makes some requests and currently it just calls
    url.httpPost()
    for instance, but I would like to somehow validate the requests that are made
    d
    • 2
    • 3
  • i

    itnoles

    03/03/2021, 12:33 AM
    @Derk-Jan Karrenbeld Have you uses dependabot before?
  • d

    Derk-Jan Karrenbeld

    03/03/2021, 12:39 AM
    Yes! What's up?
  • i

    itnoles

    03/03/2021, 12:40 AM
    I dropped buildSrc for gradle extra properties in 3.x. I make a PR about dependabot. I am wondering that I am doing it right.
  • d

    Derk-Jan Karrenbeld

    03/03/2021, 1:20 AM
    Can you link me?
  • i

    itnoles

    03/03/2021, 4:24 AM
    Support dependendabot by iNoles 路 Pull Request #796 路 kittinunf/fuel (github.com)
  • d

    Derk-Jan Karrenbeld

    03/05/2021, 1:58 AM
    Yeah that looks fine
  • i

    itnoles

    12/15/2022, 4:10 AM
    Fuel 3.x is now Multiplatform. It have been rewrite it from scratch.
    馃憦 2