def _execute(self, method_function, method_name, resource, **params):
resource_uri = "<STR_LIT>".format(api_host=self.api_host, resource=resource)<EOL>url_encoded_fields = self._encode_params(params)<EOL>headers = RestClient.generate_telesign_headers(self.customer_id,<EOL>self.api_key,<EOL>method_name,<EOL>resource,<EOL>url_encoded_fields,<EOL>user_agent=self.user_agent)<EOL>if method_name in ['<STR_LIT:POST>', '<STR_LIT>']:<EOL><INDENT>payload = {'<STR_LIT:data>': url_encoded_fields}<EOL><DEDENT>else:<EOL><INDENT>payload = {'<STR_LIT>': url_encoded_fields}<EOL><DEDENT>response = self.Response(method_function(resource_uri,<EOL>headers=headers,<EOL>timeout=self.timeout,<EOL>**payload))<EOL>return response<EOL>
Generic TeleSign REST API request handler.

:param method_function: The Requests HTTP request function to perform the request.
:param method_name: The HTTP method name, as an upper case string.
:param resource: The partial resource URI to perform the request against, as a string.
:param params: Body params to perform the HTTP request with, as a dictionary.
:return: The RestClient Response object.