import requests import json import numpy as np def predictProduct(): url = "http://192.168.2.101:15030" myheaders = {'Content-Type': 'application/json'} doc_id = "12" title = "" content = "123123" data = {"doc_id":doc_id,"title":title,"content":content} resp = requests.post(url,json=data,headers=myheaders, verify=True) print(resp.content.decode("utf8")) print(json.loads(resp.content.decode("utf8"),"utf8")) if __name__=="__main__": predictProduct()