예제 #1
0
 def post_total_same(file):
     try:
         headers = [("Content-type", "application/json")]
         uri = "/exists"
         struct = {"vp": file.virtual_path, "sha256": file.sha256}
         data = json.dumps(struct)
         status, res = Util.post(config.service_host, config.service_port, uri, headers, data)
         if res != None:
             res_data = json.loads(res)
             return res_data.exists
         else:
             return False
     except:
         return False