Пример #1
0
 def send_create_show_command(self, data):
     httpConfig = HttpConfig()
     url, method = CmdReader().get_url_method_from_create_show()
     httpConfig.set_url(url)
     httpConfig.set_headers({'content-type': 'application/json'})
     httpConfig.set_data(data)
     return_json = httpConfig.req(method)
     return return_json
Пример #2
0
 def send_rec_billing_cancel_command(self, data, transcode):
     httpConfig = HttpConfig()
     path, method = CmdReader().get_url_method_rec_billing()
     new_data = OrderedDict()
     for key, val in data.items():  # go through the dictionary
         new_data[key] = OrderedDict(sorted(
             val.items()))  # sort according to keys
     checksum = get_hash(new_data,
                         transcode)  # queryString+transcode取得checksum
     data.update({'hash': checksum})
     httpConfig.set_data(data)
     httpConfig.set_url(path)
     httpConfig.set_headers({'content-type': 'application/json'})
     return_json = httpConfig.req(method)
     return return_json