I have token parameters to insert in ALL Retrofit services.
Currently all each requests, I insert a @QueryMap
@GET("resources/{resourceId}")
suspend fun request(
@Path("resourceId") resId: Int,
@QueryMap tokens: Map<String, String>
): Response
so that https://baseurl.com/resources?key1=value1&key2=value2
The Map values are constant () ex: key1=value1&key2=value2
Now I have multiple endpoints (and multiple services), how to insert the query parameters in all endpoints ? (without passing in the method).
It seems OkHttp can insert with interceptors.