【问题标题】:AsyncHttpClient RequestParams not follow sequenceAsyncHttpClient RequestParams 不遵循顺序
【发布时间】:2017-01-27 06:02:55
【问题描述】:

我的代码如下,带有调用发布方法:

RequestParams reqParams = new RequestParams();  
    reqParams.put("name", title);
    reqParams.put("date", date);
    reqParams.put("description", description);
    reqParams.put("status", status);
File file = new File(image);
    reqParams.put("image", file);

当我检查 reqParams 时它返回

status=active&description=test&name=D&date=2017-01-01&image=/storage/file/1.png。

是否可以使用我的参数(如以

开头)按顺序返回

name=D&date=2017-01-01&description=test&status=active&image=/storage/file/1.png。

提前致谢!

【问题讨论】:

    标签: android sequence loopj http-request-parameters


    【解决方案1】:

    尝试将它们放入哈希图中,然后按照文档中的说明添加到参数中

    Map<String, String> map = new HashMap<String, String>();
     map.put("first_name", "James");
     map.put("last_name", "Smith");
     params.put("user", map); // url params: "user[first_name]=James&user[last_name]=Smith"
    

    如需进一步参考和指导,您可以关注文档here

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-05-06
      • 1970-01-01
      • 2017-02-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多