声明
本文章中所有内容仅供学习交流使用,不用于其他任何目的,抓包内容、敏感网址、数据接口等均已做脱敏处理,严禁用于商业用途和非法用途,否则由此产生的一切后果均与作者无关!
侵权通过头像私信或名字简介叫我删除博客谢谢。
部分代码
public static void main(String[] args) throws Exception {
MomoEncrypt encrypt = new MomoEncrypt();
KeyExchangeResult kx = encrypt.initKeyExchange();
String userAgent = "";
String jsonParams = buildLoginParams();
...................................
// 4) 构造 headers
Map<String, String> headers = new HashMap<>();
headers.put("X-ACT", "br");
headers.put("X-Span-Id", "0");
headers.put("Cookie", sessionId);
headers.put("X-LV", "1");
headers.put("User-Agent", userAgent);
headers.put("X-KV", kx.xkv);
headers.put("X-SIGN", xSign);
headers.put("Accept-Language", "zh-CN");
headers.put("X-Trace-Id", xTraceId);
// 6) 构造 form data
Map<String, Object> form = new HashMap<>();
form.put("code_version", kx.codeVersion);
form.put("mzip", mzip);
form.put("X-KV", kx.xkv);
form.put("map_id", mapId);
form.put("ck", kx.ck);
// 7) 发送
System.out.println("\n=== 发送 HTTP 请求 ===");
HttpResponse response = HttpRequest.post("api/v2/login?fr=" + fr)
.addHeaders(headers)
.form(form)
.timeout(15000)
.execute();
System.out.println("HTTP " + response.getStatus());
String xct = response.header("x-ct");
System.out.println("x-ct: " + xct);