Files
tulin-code/webpack-2026-09-04/实战案例-医保局/医保局请求测试.py

48 lines
2.0 KiB
Python

import requests
headers = {
"Accept": "application/json",
"Accept-Language": "zh-CN,zh;q=0.9",
"Connection": "keep-alive",
"Content-Type": "application/json",
"Origin": "https://fuwu.nhsa.gov.cn",
"Referer": "https://fuwu.nhsa.gov.cn/nationalHallSt/",
"Sec-Fetch-Dest": "empty",
"Sec-Fetch-Mode": "cors",
"Sec-Fetch-Site": "same-origin",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/155.0.0.0 Safari/537.36",
"X-Tingyun": "c=B|4Nl_NnGbjwY;x=f01a0912f6204dcf",
"channel": "web",
"contentType": "application/x-www-form-urlencoded",
"sec-ch-ua": "\"Google Chrome\";v=\"155\", \"Chromium\";v=\"155\", \"Not(A:Brand\";v=\"24\"",
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": "\"Windows\"",
"x-tif-nonce": "r4tujoPe",
"x-tif-paasid": "undefined",
"x-tif-signature": "c49b83ea83eec5bde5f142c3c22f55249d1ddf0f0a91dc3b8ee030972e58c6ff",
"x-tif-timestamp": "1791892909"
}
cookies = {
"acw_tc": "2760777d17918917830697088e7f36ce5f37dca5aafa6d29eb6ed1363938ee",
"yb_header_active": "-1",
"amap_local": "310000"
}
url = 'https://fuwu.nhsa.gov.cn/ebus/fuwu/api/nthl/api/CommQuery/queryFixedHospital'
data = {
"data": {
"data": {
"encData": "3DFBCA4667B978F639BB23B95DCE4CC74CE34C33DC32F1068E9E23CA546C9EA8CCD20943B4DAE96380B41164D761DE9742C84A985FE3BABC31CB352556BB87C9C1495DB24A29AB6BC3A85AB7FCA00F33C56677481A67C67F739EE2C7D589054DC373615B5DDB33C24C5B31E61CB7643E00DDA865C3B75C85735F0744B0227B5CD0B4E7BB97C60BF8E5275CAFCAFD1E13E384C10195003FD638576645B5EF45EA"
},
"appCode": "T98HPCGN5ZVVQBS8LZQNOAEXVI9GYHKQ",
"version": "1.0.0",
"encType": "SM4",
"signType": "SM2",
"timestamp": 1791892909,
"signData": "WYKZ/kNMDOJzf1Gj7PnsMRVtJ+9tiLnB7NCnbytJeoOXUxWiTluC/GAaYrTAfk8SU6ISXddZFWegDOwNaor/UQ=="
}
}
response = requests.post(url, headers=headers, cookies=cookies, json=data)
print(response.text)
print(response)