请求方式:GET
注:请求参数须区分大小写
String url = "https://openapi.dataoke.com/api/goods/search-suggestion";
String appKey = "xxx";
String appSecret = "xxx";
TreeMap<String, String> paraMap = new TreeMap<>();
paraMap.put("version", "v1.0.2");
paraMap.put("appKey", appKey);
paraMap.put("type", "1");
paraMap.put("keyWords", "男装");
String data = ApiClient.sendReq(url, appSecret, paraMap);
SDK调用示例
String appKey = "xxx";
String appSecret = "xxx";
DtkApiClient client = DtkApiClient.getInstance(appKey,appSecret);
DtkSearchSuggestionRequest request = new DtkSearchSuggestionRequest();
request.setKeyWords("男装");
request.setType(1);
DtkApiResponse < List < DtkSearchSuggestionResponse >> execute = client.execute(request);
{
"status": 200,
"data": {
"time": 1589007492807,
"code": 0,
"msg": "成功",
"data": [{
"kw": "裙子套装",
"total": 128
}, {
"kw": "裙子半身裙",
"total": 110
}, {
"kw": "裙子套装 两件套",
"total": 69
}, {
"kw": "裙子女",
"total": 42
}, {
"kw": "裙子2020年新款",
"total": 35
}, {
"kw": "裙子仙女超仙森系",
"total": 24
}, {
"kw": "裙子两件套夏",
"total": 15
}, {
"kw": "裙子女夏",
"total": 14
}, {
"kw": "裙子女夏连衣裙",
"total": 14
}, {
"kw": "裙子女春秋",
"total": 8
}]
},
"msg": "请求成功"
}
{
"msg":"服务器错误",
"code":-1,
"time":1554365022200
}