Kasada
POST /v1/solve/kasada
默认只传站点 url。服务端跑完 p.js → /fp → ips.js → /mfc → /tl,返回业务头 data.kpsdk_head。
payload.action 可切到短路径。未传、空、或 verify / kpsdk-head / headers / biz-headers 都走全链路。
payload
| 字段 | 别名 | 说明 |
|---|---|---|
action | mode | verify(默认)/ mfc / cd / extract-salt |
basePath | base_path / sdkPath / sdk_path | 租户前缀,如 https://host/{uuid}/{uuid}。也可从 url 里剥掉 /mfc /tl /fp /p.js /ips.js |
version | 默认 j-1.2.904,写入 x-kpsdk-v | |
h | x_kpsdk_h | 已有则跳过 GET /mfc |
fc | x_kpsdk_fc | 与 h 一起传入时保留 |
ct | x_kpsdk_ct | 与 st 成对出现时走短路径,不再 POST /tl |
st | x_kpsdk_st | 见上 |
salt | x-kpsdk-cd 用。缺省从 p.js 解析 | |
pjs | script | p.js 源码,给抽 salt 用 |
pjs_url | pjsUrl | extract-salt 时远程拉 p.js |
workTime | work_time | 传给 cd 计算 |
id / duration / clockOffsetMs | clock_offset_ms | cd 可选项 |
include_fc | 为真时把 /mfc 的 fc 写进 kpsdk_head |
全链路还需要顶层 url(站点首页或已经是租户前缀)。
默认:全链路
json
{
"url": "https://www.wizzair.com/",
"timeout": 90000,
"payload": { "version": "j-1.2.904" }
}已知租户路径时少一次首页解析:
json
{
"url": "https://www.wizzair.com/",
"timeout": 90000,
"payload": {
"basePath": "https://www.wizzair.com/149e9513-01fa-4fb0-aad4-566afd725d1b/2d206a39-8ed7-437e-a3be-862e0f06eea3"
}
}data(全链路)
json
{
"kpsdk_head": {
"x-kpsdk-ct": "...",
"x-kpsdk-h": "...",
"x-kpsdk-v": "j-1.2.904",
"x-kpsdk-cd": "..."
},
"basePath": "https://www.wizzair.com/{uuid}/{uuid}",
"ct": "...",
"st": 123,
"h": "...",
"fc": "...",
"version": "j-1.2.904",
"cookie": "...",
"tl_status": 200,
"mfc_status": 200,
"tl_body_len": 12345
}把 kpsdk_head 原样铺到后续业务请求头即可。fc 默认不进 kpsdk_head,除非 include_fc。
页面解析不到 Kasada 路径时:INVALID_INPUT,提示传 payload.basePath。
已有 ct / st(短路径)
payload 同时带 ct 和 st 时,不再跑 /tl,只补 h 和 cd:
json
{
"url": "https://www.wizzair.com/",
"payload": {
"ct": "...",
"st": 123,
"basePath": "https://www.wizzair.com/{uuid}/{uuid}"
}
}返回 { kpsdk_head, basePath, mfc_status }。
action=mfc
只 GET /mfc 拿 h:
json
{
"url": "https://www.wizzair.com/{uuid}/{uuid}",
"payload": { "action": "mfc" }
}data:{ h, fc, status, basePath, version }。缺 url/basePath → INVALID_INPUT。
action=cd
本地算 x-kpsdk-cd,不出网(除了你自己没传 salt 时也不会去拉 p.js,salt 必须可解析):
json
{
"payload": {
"action": "cd",
"ct": "...",
"st": 123,
"salt": "..."
}
}data:{ cd, salt }。缺 ct/st → INVALID_INPUT。
action=extract-salt
json
{
"payload": {
"action": "extract-salt",
"pjs": "/* p.js source */"
}
}或传 pjs_url 让服务端去拉。data 为抽 salt 结果(含 salt 等字段)。