URL hit by Retrofit Client

The URL that is formed and hit by EndpointInterface using Retrofit Client can be obtained by below:

 call.enqueue(new Callback<VideoList>() {
    @Override    public void onResponse(Call<VideoList> call, Response<VideoList> response) {
        Log.d("URL: ", call.request().url().toString()); // here
        if(response.isSuccessful()) {
        }
    }

    @Override    public void onFailure(Call<VideoList> call, Throwable t) {
    }
 });

Comments

Popular posts from this blog

@Overrride annotation introduced in Java1.5

Liskov Substitution Principle (LSP)

Interface Segregation Principle