I use Retrofit for my network layer in my Android app, but I have a problem with URL encoding.
I need to call the REST API:
https:
since you can see that the query string consists of several parameters, so I decided to use the @QueryMap annotation in the Retrofit interface with Map<String, String> , where q, param[1], param[0], other_param are map string keys
What am I expecting? I expect the square brackets in the URL are encoded with %5B for '[' and %5D for '[' , but this does not happen.
Why is this happening? Square brackets must be encoded with percent encoding. Is this a mistake, or am I doing something wrong? I also tried the @EncodedQueryMap annotation without any differences.
source share