| | |
| | | |
| | | public class DaTaoKeApiUtil { |
| | | |
| | | final static String API_CHARSET = "ISO-8859-1"; |
| | | final static String API_CHARSET = "UTF-8";//"ISO-8859-1"; |
| | | |
| | | final static String API_KEY = "a083abb893"; |
| | | final static String API_KEY_2 = "b7a5ea2cd9"; |
| | |
| | | } |
| | | } |
| | | String result = HttpUtil.get(url, 10000); |
| | | |
| | | try { |
| | | if (result != null) |
| | | return new String(result.getBytes("ISO-8859-1"), "UTF-8"); |
| | | return new String(result.getBytes(API_CHARSET), "UTF-8"); |
| | | } catch (UnsupportedEncodingException e) { |
| | | } |
| | | |
| | | return result; |
| | | } |
| | | |
| | |
| | | TaoKeAppInfo app = getRandomApp(); |
| | | DaTaoKeGoodsResult daTaoKeGoodsResult = new DaTaoKeGoodsResult(); |
| | | Map<String, String> params = new TreeMap<>(); |
| | | params.put("version", "v2.1.0"); |
| | | params.put("version", "v2.1.2"); |
| | | params.put("appKey", app.getAppKey()); |
| | | params.put("pageSize", pageSize + ""); |
| | | params.put("pageId", page + ""); |