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() return request
def __create_request_by_get_with_signature(self, url, builder): request = RestApiRequest() request.method = "GET" request.host = self.__server_url create_signature(self.__api_key, self.__secret_key, request.method, request.host + url, builder) request.header.update({"Content-Type": "application/x-www-form-urlencoded"}) request.url = url + builder.build_url() return request
def __create_request_by_post_with_signature(self, url, builder): request = RestApiRequest() request.method = "POST" request.host = self.__server_url create_signature(self.__api_key, self.__secret_key, request.method, request.host + url, builder) request.header.update({'Content-Type': 'application/json'}) request.post_body = builder.post_map request.url = url + builder.build_url() return request