""" @author: luojunhui """ import json import time import requests """ cate: video_return, video_view, video_rov """ url = "http://47.99.132.47:8888/videos" body = { "cate": "video_return", "start_date": "2024-05-28", "end_date": "2024-05-29", "topN": 5 } a = time.time() header = { "Content-Type": "application/json", } response = requests.post(url, json=body, headers=header, timeout=600) b = time.time() print(b - a) print(json.dumps(response.json(), ensure_ascii=False, indent=4)) # with open("test_return.json", "w", encoding="utf-8") as f: # f.write(json.dumps(response.json(), ensure_ascii=False, indent=4))