Run call in retrofit 2

Asked

Viewed 17 times

1

I am having trouble creating the call with retrofit 2 to the following url: https://api.themoviedb.org/3/movie/2310?api_key=MINHA_API_KEY&language=pt-BR

On android, the call I’m making is returning an error, I do not know if it is because the model is wrong or if I’m doing the incorrect GET:

@GET("movie/{id}?")
fun getMovie(@Path("id") id: String,
             @Query("apiKey") apiKey: String,
                 @Query("language") lang : String = "pt-BR" ): Call<Movie>

Could you help me find out if the GET I built is necessarily turning into the url I mentioned at the beginning? If so, I’ll go for model analysis

1 answer

0

Man, I had a similar problem once, I think the flaw is in here @Query("apiKey") apiKey: String. I think it should be @Query("api_key") apiKey: String.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.