title: Retrofit - Pass URL values dynamically - GET method
body: <p>I have a URL for example : </p>
  
  <p><a href="https://vpic.nhtsa.dot.gov/api/vehicles/DecodeVinValues/KMHDC8AEXAU084769?format=JSON" rel="nofollow noreferrer">https://vpic.nhtsa.dot.gov/api/vehicles/DecodeVinValues/KMHDC8AEXAU084769?format=JSON</a></p>
  
  <p>Here I want to change <code>KMHDC8AEXAU084769?format=JSON</code> this part dynamically</p>
  
  <p>How to do it with Retrofit2.</p>
  
  <p>I tried like:</p>
  
  <pre><code>@FormUrlEncoded
      @GET("{input}")
      Call&lt;Result&gt; getVin(@Path("input") String input, @Field("format") String format);
  </code></pre>
  
  <p>But <code>@FormUrlEncoded</code> is only supports for POST not for GET.</p>
  
  <p>This is the way I am calling it:</p>
  
  <pre><code>ApiInterface apiService = ApiClient.getClient().create(ApiInterface.class);
  
          Call&lt;Result&gt; call = apiService.getVin(vin, "JSON");
          call.enqueue(new Callback&lt;Result&gt;() {
              @Override
              public void onResponse(Call&lt;Result&gt; call, Response&lt;Result&gt; response) {
                  Result result = response.body();
  
                  Log.e("Result: ", "" + response.body());
  
                  Gson gson = new Gson();
                  String json = gson.toJson(result);
  
                  responseTV.setText("" + json);
              }
  
              @Override
              public void onFailure(Call&lt;Result&gt; call, Throwable t) {
                  // Log error here since request failed
                  Log.e("MainActivity", t.toString());
                  Toast.makeText(MainActivity.this, "Try later", Toast.LENGTH_SHORT).show();
              }
          });
  </code></pre>