0) I am using Retrofit 2 for work with Bank API.
1) I have some interface:
public interface ApiService {
@GET("statdirectory/exchange")
Call<List<MyModel>> getСurrency(@Query("date") String inputDate);
}
2) And when i call method getСurrency(someParametr), where someParametr is string, consist with "date&json" (for example, "20170917&json"):
ApiService apiService = RetrofitController.getApi();
apiService.getCurrency("20170917&json").enqueue(new Callback<List<MyModel>>() {
@Override
public void onResponse(Call<List<MyModel>> call, Response<List<MyModel>> response) {
call.request().url();
Log.e("URL", call.request().url()+"");
response.code();
Log.e("CODE", response.code()+"");
}
//.....
3) I see that:
URL: "https://bank.gov.ua/NBUStatService/v1/statdirectory/exchange?date=20170917%26json" (& is replaced by %26)
CODE: "404"
4) Inmy interface i add encoded:
getСurrency(@Query(value="date", encoded=false) String inputDate);
But my result is the same as in step 3!
5) How to check this problem? How to get URL without %26 on my string? I read other questions with similar problem, but isn't solve my problem. Thanks!