def make_request(self, text):
     """Make API request."""
     request_data = text.encode('utf-8')
     raw_response = make_post_request(self.endpoint_uri, request_data,
                                      **self.get_request_kwargs())
     response = self.decode_rpc_response(raw_response)
     return response
Example #2
0
 def make_request(self, method, params):
     request_data = self.encode_rpc_request(method, params)
     raw_response = make_post_request(
         self.endpoint_uri,
         request_data,
         **self.get_request_kwargs()
     )
     response = self.decode_rpc_response(raw_response)
     return response
Example #3
0
 def make_request(self, text):
     self.logger.debug("Making request HTTP. URI: %s, Request: %s",
                       self.endpoint_uri, text)
     request_data = text.encode('utf-8')
     raw_response = make_post_request(self.endpoint_uri, request_data,
                                      **self.get_request_kwargs())
     response = self.decode_rpc_response(raw_response)
     self.logger.debug(
         "Getting response HTTP. URI: %s, "
         "Request: %s, Response: %s", self.endpoint_uri, text, response)
     return response
Example #4
0
 def make_request(self, method, params):
     self.logger.debug("Making request HTTP. URI: %s, Method: %s",
                       self.endpoint_uri, method)
     request_data = self.encode_rpc_request(method, params)
     raw_response = make_post_request(self.endpoint_uri, request_data,
                                      **self.get_request_kwargs())
     response = self.decode_rpc_response(raw_response)
     self.logger.debug(
         "Getting response HTTP. URI: %s, "
         "Method: %s, Response: %s", self.endpoint_uri, method, response)
     return response
Example #5
0
 def make_request(self, method, params):
     request_data = self.encode_rpc_request(method, params)
     raw_response = make_post_request(self.endpoint_uri, request_data,
                                      **self.get_request_kwargs())
     response = self.decode_rpc_response(raw_response)
     return response
Example #6
0
 def retriable_post_request(self, request_data):
     return make_post_request(self.endpoint_uri, request_data,
                              **self.get_request_kwargs())