So I'm looking to make a request to our api to log in a user, however there is a section that gets encoded in the Retrofit 2 method even though its set as encoded = true
. The base url is https://testapi.test.ie
The parameter I pass as the serverext
is mdc.php?action=
However even after setting encoded = true
the resulting request body is: https://testapi.test.ie/mdc.php%3Faction=login_user&ts=1482924232742
where I require it to be: https://testapi.test.ie/mdc.php?action=login_user&ts=1482924232742
So I can see the issue is the ?
symbol. Below is my retrofit method, if anyone can help with this I would appreciate it in order to achieve the correct
@retrofit2.http.POST("/{serverext}login_user&ts={timestamp}")
@retrofit2.http.Multipart
Call<LoginResponseModel> loginUser(@retrofit2.http.Path(value = "serverext", encoded = true) String server,
@retrofit2.http.Part(Constants.USER) String username,
@retrofit2.http.Part(Constants.PASS) String password,
@retrofit2.http.Path("timestamp") Long timestamp);