AsyncHttpClient RequestParams 不遵循顺序
AsyncHttpClient RequestParams not follow sequence
我的代码如下,调用 post 方法:
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 时 return
status=active&description=test&name=D&date=2017-01-01&image=/storage/file/1.png.
是否可以 return 跟随我的参数的顺序,例如从
开始
name=D&date=2017-01-01&description=test&status=active&image=/storage/file/1.png.
提前致谢!
尝试将它们放入哈希图中,然后按照其文档中的描述添加到参数中
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
我的代码如下,调用 post 方法:
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 时 return
status=active&description=test&name=D&date=2017-01-01&image=/storage/file/1.png.
是否可以 return 跟随我的参数的顺序,例如从
开始name=D&date=2017-01-01&description=test&status=active&image=/storage/file/1.png.
提前致谢!
尝试将它们放入哈希图中,然后按照其文档中的描述添加到参数中
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