hi, everyone I'm using Ktor client 2.0.x with Bear...
# ktor
h
hi, everyone I'm using Ktor client 2.0.x with Bearer Auth. I have many requests don't need authorization. what is the way to tell Ktor don't add authorization header
r
you can use
sendWithoutRequest
to filter which requests get header by default. like
Copy code
Auth {
  bearer {
    ...
    sendWithoutRequest { it.url.host == "my.host" }
  } 
}
h
thanks @Rustam Siniukov i get it Auth { bearer { ... sendWithoutRequest { !it.url.pathSegments.containsAll(listOf("", "")) } } }