This commit is contained in:
27942
2025-10-22 11:57:33 +08:00
parent 71de951a2f
commit d8ff5023cb
3 changed files with 317 additions and 13 deletions

41
test.py
View File

@@ -1,9 +1,38 @@
import json
import requests
# 定义一个 Python 字典
data = {"relationship":"111","name":"1111","phone":"11111111111","workPlace":"11111111","address":"1111"}
headers = {
'Accept': '*/*',
'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6',
'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjp7InVpZCI6IjY0MzNiMDMyNTBmYTQ5YTI1ZWNlYmQzMCIsInZlcnNpb24iOjAsImJyYW5jaCI6InpoIiwicGhvbmUiOiIxNzE2ODM2MDQwOCJ9LCJpYXQiOjE3NjExMDMyNzcsImV4cCI6MTc2MTI3NjA3N30.k_R1gSUW9XpE6uRiCdHrEA8MXGjGpGoWVTrhSGz-0Cc',
'Cache-Control': 'no-cache',
'Connection': 'keep-alive',
'DNT': '1',
'Pragma': 'no-cache',
'Sec-Fetch-Dest': 'empty',
'Sec-Fetch-Mode': 'cors',
'Sec-Fetch-Site': 'none',
'Sec-Fetch-Storage-Access': 'active',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36 Edg/141.0.0.0',
'i-app': 'hitab',
'i-branch': 'zh',
'i-lang': 'zh-CN',
'i-platform': 'edge',
'i-version': '2.2.16',
'sec-ch-ua': '"Microsoft Edge";v="141", "Not?A_Brand";v="8", "Chromium";v="141"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"Windows"',
}
# 使用 json.dumps() 方法将字典转换为 JSON 字符串
json_string = json.dumps(data)
response = requests.get('https://api.wetab.link/api/chat-v3/chat/history', headers=headers)
print(json_string)
for i in response.json()["data"]['list']:
print(i)
json_data = {
'clId': i["id"],
'source': 'chat',
}
response = requests.post('https://api.wetab.link/api/chat-v3/conversation/delete', headers=headers, json=json_data)
print(response.json())