-1

I want to use movieId in the @GET() but the thing is I want to use a different variable each time.

I have this interface file, and I am calling it in MainActivity for retrofit. I have tried to () after the interface's name, to pass the data as a parameter, but it doesn't work. What should I do?

interface MovieRecommendationsApiInterface {
    @GET("xxxxxxx")
    fun getRecommendationsList(): Call<MovieResponse>
}
user19514005
  • 177
  • 1
  • 7

1 Answers1

0

If you want to pass movie id. You can modify your method this way.

@GET("movies/{id}")
fun getRecommendationsList(@Path("id") id: Int?): Call<MovieResponse>
Abdullah Javed
  • 459
  • 3
  • 17