As of Retrofit 2.0.0-beta2, if you have a service responding JSON from this URL : http://myhost/mypath
The following is not working :
public interface ClientService {
@GET("")
Call<List<Client>> getClientList();
}
Retrofit retrofit = new Retrofit.Builder()
.baseUrl("http://myhost/mypath")
.addConverterFactory(GsonConverterFactory.create())
.build();
ClientService service = retrofit.create(ClientService.class);
Response<List<Client>> response = service.getClientList().execute();
But this is ok :
public interface ClientService {
@GET
Call<List<Client>> getClientList(@Url String anEmptyString);
}
Retrofit retrofit = new Retrofit.Builder()
.baseUrl("http://myhost/mypath")
.addConverterFactory(GsonConverterFactory.create())
.build();
ClientService service = retrofit.create(ClientService.class);
Response<List<Client>> response = service.getClientList("").execute();