title: Fetch data from server using retrofit method
body: <p>i want fetch data from server, i have API URL like example : <a href="https://example.com/PlanController/getData/2/7k" rel="nofollow noreferrer">https://example.com/PlanController/getData/2/7k</a> Plan, int his api url <strong>2</strong> is dynamic value and <strong>7k plan</strong> is also dynamic Value. i want fetch data from retrofit method. give me some examples.</p>
  
  <pre><code>public interface APIService {
  
      @GET("PlanController/getData")
      Call&lt;CoachListResponse&gt; getAllData(); 
  }
  </code></pre>
  
  <p>Retrofit clint</p>
  
  <pre><code> public class RetrofitClient {
  
  private static Retrofit retrofit = null;
  
  public static Retrofit getClient(String baseUrl) {
  
      Gson gson = new GsonBuilder().setLenient().create();
  
      if (retrofit == null) {
          retrofit = new Retrofit.Builder()
                  .baseUrl(baseUrl)
                  .addConverterFactory(GsonConverterFactory.create(gson))
                  .build();
      }
      return retrofit;
  }
  }
  </code></pre>