kittinunf / fuel

The easiest HTTP networking library for Kotlin/Android

Home Page:https://fuel.gitbook.io/documentation/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fuel.post returns status -1

jazzdev opened this issue · comments

    val (request, response, result) = Fuel.post("/envelopes")
        .jsonBody(envelopeDefinition)
        .response()
    println("R: ${response.statusCode} ${response.responseMessage}")

output:

R: -1 

I suspect it's some kind of network problem (DNS or firewall). Can I get more details on the error from Fuel so I can debug it?

The problem was SSL cert validation failed. I just switched to HTTP.

The fix for issue #782 should work also, but I didn't try it.

The real answer to my issue (how to get details on the error message) is:

result.onError {
        println("Error: ${it.message}")
    }