http://api.helper.qq.com/search/getresultbytype
这个地址是我抓包王者荣耀战绩查询得到的地址。
附上相关代码。
public static void main(String[] args) throws IOException {
OkHttpClient okHttpClient = new OkHttpClient();
String url = "http://api.helper.qq.com/search/getresultbytype";
Request request = new Request.Builder()
.url(url)
.addHeader("Accept-Encoding", "gzip")
.build();
Response response = okHttpClient.newCall(request).execute();
GzipSource responseBody = new GzipSource(response.body().source());
BufferedSource bufferedSource = Okio.buffer(responseBody);
String read = bufferedSource.readUtf8();
System.out.println(read);
// System.out.println(response.body().string());
}
看响应 Content-Encoding:gzip 有 GZIP,就算用手动解压或者自动解压,都发现结果是一样的。
我怀疑是被加密后的数据,所以想问问有没有人有类似的经验帮忙解答,万分感谢。