http://api.polyv.net/v2/cata/total-stats
{
"code": 200,
"status": "success",
"message": "success",
"data": {
"videoNum": 28,
"usedSpace": 673027885
}
}
签名不正确
{
"code":400,
"status":"error",
"message":"the sign is not right",
"data":""
}
时间戳过期
{
"code":400,
"status":"error",
"message":"ptime is too old.",
"data":""
}
不合法的分类ID
{
"code":400,
"status":"error",
"message":"illegal cataid",
"data":""
}
@Test
public void testGetCataTotalStats() throws Exception {
String url = "http://api.polyv.net/v2/cata/total-stats";
String userid = "xxxxxxxxxx";
long cataid = 1L;
String secretkey = "xxxxxxxxxx";
Map<String, String> params = new HashMap<>();
params.put("userid", userid);
params.put("cataid", String.valueOf(cataid));
params.put("containSubCata", String.valueOf(true));
params.put("ptime", String.valueOf(System.currentTimeMillis()));
params.put("sign", getSign(params, secretkey));
String response = HttpClientUtil.getInstance().sendHttpGet(url + "?" + PolyvTool.mapJoinNotEncode(params));
System.out.println(response);
}