Jose Jose - 1 year ago 98
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);


Answer Source

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();
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download