def __create_request_by_get(self, url, builder): request = RestApiRequest() request.method = "GET" request.host = self.__server_url request.header.update({'Content-Type': 'application/json'}) request.url = url + "?" + builder.build_url() request.proxy = self.__proxy return request
def __create_request_by_get_with_apikey(self, url, builder): request = RestApiRequest() request.method = "GET" request.host = self.__server_url request.header.update({'Content-Type': 'application/json'}) request.header.update({"X-MBX-APIKEY": self.__api_key}) request.url = url + "?" + builder.build_url() request.proxy = self.__proxy # For develop print("====== Request ======") print(request) PrintMix.print_data(request) print("=====================") return request
def __create_request_by_delete_with_signature(self, url, builder): request = RestApiRequest() request.method = "DELETE" request.host = self.__server_url builder.put_url("recvWindow", 60000) builder.put_url("timestamp", str(get_current_timestamp() - 1000)) create_signature(self.__secret_key, builder) request.header.update({'Content-Type': 'application/json'}) request.header.update({"X-MBX-APIKEY": self.__api_key}) request.url = url + "?" + builder.build_url() request.proxy = self.__proxy # For develop print("====== Request ======") print(request) PrintMix.print_data(request) print("=====================") return request