Add query params to a GET request in okhttp in Android

后端 未结 4 806
星月不相逢
星月不相逢 2021-01-12 00:56

Is there a way to add query params (?param1=val1¶m2=val2) to a GET request using okhttp in Android?

I am looking for an API and no

4条回答
  •  孤街浪徒
    2021-01-12 01:29

    import android.net.Uri
    var url = Uri.parse(urlWithoutQueryParams).buildUpon().appendQueryParameter("key","value").build().toString()
    

提交回复
热议问题