import threading import requests # 散户多线程提交换房 def login_test(url): data = { "contract_person_code": "240729000003", "energy_details": } headers = { "token":"B*******E" } res = requests.post(url=url, json=data, headers=headers) print(res.json()) # 创建要请求的URL列表 urls = ["http://*******/api/v4.0/ContractChange/SaveStoreChangePerson" for i in range(0, 4)] # 创建线程列表 threads = [] # 创建并启动线程 for url in urls: thread = threading.Thread(target=login_test, args=(url,)) thread.start() # threads.append(thread) # 等待所有线程执行完毕 for thread in threads: thread.join() # 等待所有线程执行完毕 # for thread in threads: