Android Retrofit's @Path don't work. Why?

I have an app which takes trivia question from api and display. When I use the actual link for take questions it works ( ) . However when I add path for categories, app does not work.

This is work :

Call<List<Questions>> general();

However this is not work :

Call<List<Questions>> getData(@Path("type") String type);

Also when I delete the app from emulator, and install again with path include method, it works just once. Not second time.

Answers 1

  • categories is not a path parameter, it's a query, do this instead

    Call<List<Questions>> getData(@Query("categories") String categories);

    and about the second problem you mentioned, there's noting in the provided code to find out from

Related Articles