android - 当 URL 中有 "?"时,改造 POST 请求转换为 GET 请求

标签 android post opencart retrofit

当URL是这样的时候,Retrofit将GET请求中的POST转换

https://www.example.com/index.php?route=api/account/login

最佳答案

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/

相关文章:

jquery - 使用 Jquery 将变量通过 POST 传递到另一个页面

php - OpenCart SQL请求并显示在产品模板页面上

php - opencart如何在首页显示所有带图片的分类 opencart 1.5.1.3

android - Gradle 构建失败 : Cannot create directory/home/vassar/. android/build-cache/3.4.0

android - Dagger2 dagger.android.* 类不存在

javascript - 对触发调用的表单的 jQuery 引用

php - 将 PHP POST 响应的 JSON 主体编码为 HMAC SHA256,然后编码为 Base64

Opencart 3主题开发

android - RadioButton 未初始化

android - 启用双向 ScrollView react 原生