123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- import requests
- import json
- url = 'http://172.17.0.1:8888/analysis/time'
- data={
- "ids":[67803,67804],
- "windCode":"SKF001",
- "analysisType":"time",
- "fmin":None,
- "fmax":None,
- }
- json_data = json.dumps(data)
- print(json_data)
- headers = {
- 'Content-Type': 'application/json'
- }
- response = requests.post(url, headers=headers, data=json_data)
- # print("response:",response.json())
- if response.status_code == 200:
- # print(response.json())
- # print("response.text",response.text) # 打印原始响应内容
- try:
- data = response.json()
- print(data)
- except json.JSONDecodeError as e:
- print(f"解析JSON时出错: {e}")
- else:
- print(f"Error: {response.text}")
- '''
- {"ids": [67803, 67804],
- "windCode": "SKF001_wave",
- "analysisType": "trend",
- "fmin": null,
- "fmax": null}
- {"type": "trend",
- "data": [{"fs": 2560.0,
- "Mean": -0.0,
- "Max": 4.84,
- "Min": -6.0,
- "Xrms": 1.59,
- "Xp": 5.42,
- "If": 4.26,
- "Cf": 3.42,
- "Sf": -128989487.68,
- "Ce": 5.02,
- "Cw": 1.58,
- "Cq": 2.91,
- "velocity_rms": 0.03491697493565808,
- "time_stamp": "2024-07-01 00:00:14"},
- {"fs": 2560.0,
- "Mean": 0.0,
- "Max": 0.13,
- "Min": -0.17,
- "Xrms": 0.06,
- "Xp": 0.15,
- "If": 3.13,
- "Cf": 2.56,
- "Sf": 115003052.92,
- "Ce": 3.63,
- "Cw": 1.51,
- "Cq": 2.6,
- "velocity_rms": 0.05647856377107759,
- "time_stamp": "2024-07-01 00:00:27"}]}
- '''
|