Hultool之HttpUtil用法笔记
作者:互联网
// 传递String数组
String strArr = new String[2];
strArr[0] = "t1";
strArr[1] = "t2";
final String testurl = Global.getConfig("ipport") + "/testurl"; final HashMap<Object, Object> map = Maps.newHashMap(); map.put("strArr", strArr); final String resultJson = HttpUtil.post(testurl, map);
public JsonResult accept(final String[] strArr){ // TODO }
//传递对象集合 JSONArray testarray = new JSONArray();
foreach{
JSON jsonbean = JSONUtil.parse(bean);
testarray.put(jsonbean);
} HashMap<String, Object> tm= new HashMap<>(); tm.put("jsonstr", testarray.toString()); String result = HttpUtil.post(internetUrl, tm);
public JsonResult accept(final String jsonstr){ // TODO }
标签:String,strArr,用法,tm,Hultool,HttpUtil,final,HashMap 来源: https://www.cnblogs.com/bkywanly/p/11434981.html