Jose Jose - 5 days ago 6
Java Question

Consuming apis with Retrofit without @PATH

I'm consuming from in order to
show a country list, but AS throw me an error when using the @PATH,
what can i do?

public interface ICountryService {

String ENDPOINT = "";

Call<List<Country>> getCountry(@Path("country") String country);



The country variable is looking for a {country_id} inside the URL. You should remove the @Path.

You need to do it like:

@GET("/rest/v1/all") Call<List<Country>> getCountry();