""" @author: luojunhui """ import json import requests import time url = "http://localhost:6060/nlp" body = { "data": { "text_a": "毛主席", "text_b": "毛泽东" }, "function": "similarities" } headers = {"Content-Type": "application/json"} a = time.time() response = requests.post(url=url, headers=headers, json=body) b = time.time() print(json.dumps(response.json(), ensure_ascii=False, indent=4)) print(b - a)