I'm new to android development and still learning Kotlin so my question may be simple.
So, what i want to achieve is to have getRequest() function overloaded for multiple Query parameters.
For example this are two of my functions:
@GET("{path}")
fun getRequest(
@Path("path") path: String?,
@Query("country") country : String,
@Query("apiKey") apiKey: String): Call<String>
@GET("{path}")
fun getRequest(
@Path("path") path: String?,
@Query("q") q: String,
@Query("from") from:String,
@Query("to") to: String,
@Query("sortBy") sortBy: String,
@Query("apiKey") apiKey: String): Call<String>
The problem I have is I want to have another getRequest() function with same amount of parameters as the first one
So how can I achieve this if the Query parameter has to be different
@GET("{path}")
fun getRequest(
@Path("path") path: String?,
@Query("q") q: String,
@Query("apiKey") apiKey: String): Call<String>