Spaces:
Runtime error
Runtime error
File size: 530 Bytes
ffc02c6 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
import requests
#獲取用戶的服務器信息
def GetUserData(sub):
# 发送GET请求
response = requests.get(f'https://tilents.sinaapp.com/assistant/search_userInfo.php?sub={sub}')
# 检查响应状态码
if response.status_code == 200:
# 成功获取数据
data = response.json() # 如果响应是JSON格式的数据
print(f"GetUserData{data}")
return data
else:
print(f'Failed to fetch data. Status code: {response.status_code}')
return None
GetUserData() |