当URL是这样的时候,Retrofit将GET请求中的POST转换
最佳答案
Found the solution
@FormUrlEncoded
@POST("index.php")
Call<String> login(@QueryMap(encoded=true) Map<String, String> options,@Field("email") String username,@Field("password") String password);
and calling will be like this
Map<String, String> map = new HashMap<>();
map.put("route","restapi/account/login");
Call<String> call = mAPIService.login(map, email, password);
关于android - 当 URL 中有 "?"时,改造 POST 请求转换为 GET 请求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49469413/