Reputation: 15656
In my android project I use Retrofit 2
@GET("/transfers/tunnels")
fun getTunnelsList(
@Query("destination[id]") destinationId: String,
@Query("amuunt") amount: Double,
@Query("currency") currency: String
): Call<List<Tunnel>>
And here result:
-> GET http://my_ip/transfers/tunnels?destination%5Bid%5D=9eb5fd41-16f8-430c-91b7-a69ad1fd4c89&amuunt=4.0¤cy=EUR http/1.1
But I need param with name destination[id]
smt like this:
-> GET http://my_ip/sends?preferred_agent[id]=12345&amuunt=12.1¤cy=USD&receiver[id]=receiverID_guid&destination[id]=destinationId_guid&contract[id]=contractId_guid&is_ready=false
How I can do this?
Upvotes: 0
Views: 62
Reputation: 8422
You can set encoded
parameter of Query
annotation to true
. Then it'll work as intended
@GET("/transfers/tunnels")
fun getTunnelsList(
@Query("destination[id]", encoded = true) destinationId: String,
@Query("amuunt") amount: Double,
@Query("currency") currency: String
): Call<List<Tunnel>>
Upvotes: 1