Sobes.tech
Middle

How to specify a parameter at a certain position in the path in a GET method in Retrofit?

sobes.tech AI

Answer from AI

@GET("users/{id}") // {id} - placeholder for the path parameter
fun getUser(@Path("id") userId: String): Call<User> // @Path("id") links the method parameter to the placeholder