https://kotlinlang.org logo
#ktor
Title
# ktor
c

CLOVIS

06/09/2021, 8:16 AM
Did someone manage to use JWT with a Ktor client? The documentation doesn't even say if it's possible or not
a

audriusk

06/09/2021, 8:41 AM
c

CLOVIS

06/09/2021, 9:41 AM
Oh, is that JWT-compatible? I'll try having the JWT token there, but what's the refreshToken ?
a

Ankit Dubey

06/09/2021, 12:21 PM
I’ve done something like this
Copy code
val res = <http://mClient.post|mClient.post><T>("${baseURL}$mUrl") {
    body = query
    headers {
        if (token != null)
            append(HttpHeaders.Authorization, token)
    }
}
Screenshot 2021-06-09 at 5.52.32 PM.png