There is such API https://api.privatbank.ua/p24api/exchange_rates?json&date=01.12.2014 using retrofit I want to get json with the specified parameters (date)
Here is my interface
public interface PrivatApi { @GET("p24api/exchange_rates") Call<List<Rate>> getSelectedData(@Query("date") String date); } Do I pass the date parameter correctly? my method does not work! (
private void getRatesOnDate( ) { retrofit = new Retrofit.Builder() .baseUrl(URL) .addConverterFactory(GsonConverterFactory.create()) .build(); service = retrofit.create(PrivatApi.class); rates = new ArrayList<>(); String selectedate = "31.03.2014"; service.getSelectedData("", selectedate).enqueue(new Callback<List<Rate>>() { @Override public void onResponse(Call<List<Rate>> call, Response<List<Rate>> response) { rates.addAll(response.body()); } @Override public void onFailure(Call<List<Rate>> call, Throwable t) { Log.e("MyLog", "onFailure" + t.toString()); } }); }