String url = "https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=" + token; JSONObject jsonObject = new JSONObject(); jsonObject.put( "page" , page); jsonObject.put( "width" , width); jsonObject.put( "scene" , scene); jsonObject.put( "auto_color" , "true" ); // jsonObject.put("line_color", "{\"r\":\"0\",\"g\":\"0\",\"b\":\"0\"}"); JSONObject result = HttpRequestUtil.httpsRequest(url, "POST" , jsonObject.toJSONString()); if (result.containsKey( "errcode" )) { throw new RuntimeException(result.toString()); } return jsonObject; |
jsonObject参数:{"auto_color":"true","page":"pages/index/detail/detail","scene":"{\"partsId\":\"1960a316ce1247a3957230a827f157b7\"}","width":"200"}
报错:{"errcode":47001,"errmsg":"data format error hint: [vUT22a0120wxa5]"}
楼主,问题解决了吗?
确认一下 width数据格式是数字而不是字符串,auto_color数据格式是bool而不是字符串