Search code examples
androidretrofit

Retrofit query with multiple comma seperated values (Q=1,2,3,5,8)


@GET("?bs")
Observable<Response> getSomething(@Query("type") String first, String second, String third)

I want the end result like this:

api.com/endpoint/type=first,second,third

How do I accomplish this?


Solution

  • You can use a single String parameter:

    Observable<Response> getSomething(@Query("type") String type)

    and then call it like this: getSomething("1,2,3,5,8") .