I am trying to consume a GET API that expects in its query params list an array of strings.
I am using Retrofit for the task.
In the API interface, I have the following defined:
@GET("user/explore")
Observable<User> fetchUsers(@Query("who") String who,
@Query("category") ArrayList<String> categories);
I am using Timber for logging and in the console, I see the request is made like the following:
http://192.168.2.208:3000/api/v1/user/explore?who=SOME_USER&category=SOME_CATEGORY
The expected request should be made like the following:
http://192.168.2.208:3000/api/v1/user/explore?who=SOME_USER&category=[SOME_CATEGORY,SOME_CATEGORY1,SOME_CATEGORY2]
Why is retrofit behaving this way event though categories are of type string arraylist?