def send_request(self, kind, resource, url_components, **kwargs):
url = self.format_request_url(resource, *url_components)<EOL>meth = getattr(requests, kind)<EOL>headers = self.get_request_headers()<EOL>req_data = self.format_parameters(**kwargs)<EOL>response = meth(url, headers=headers, data=req_data)<EOL>data = self.get_response(response)<EOL>if response.status_code >= <NUM_LIT>:<EOL><INDENT>msg = data.pop('<STR_LIT:message>', '<STR_LIT>')<EOL>raise APIError(msg, response.status_code, **data)<EOL><DEDENT>return data<EOL>
Send a request to the REST API

Parameters
----------
kind: str, {get, delete, put, post, head}
resource: str
url_components: list or tuple to be appended to the request URL

Notes
-----
kwargs contain request parameters to be sent as request data