How to send empty string on query parameter retrofit kotlin

Viewed 62

I have an API URL like https://api.github.com/search/users?q="", so I try to hit it with the postman, and it is fine. enter image description here

And then I want to implement that request using retrofit. So I create an Query Parameter on retrofit, like this,

@GET("search/users")
@Headers("Authorization: token ${BuildConfig.TOKEN}")
fun searchUser(
   @Query("q") username: String
): Call<UserListResponse>

And then call the searchUser like this searchUser(""), but the URL that generated does not show the empty string url=https://api.github.com/search/users?q=.

Is it possible to send an empty string on a query parameter using retrofit?

0 Answers
Related