<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def send_request(self, url, params, method='GET'):
 """Sends a raw request to the given api endpoint. :arg url: A Nexmpo api endpoint (json only) :arg params: A parameter dictionnary Returns a :class:`~libnexmo.NexmoResponse`. Raises: The library uses `Requests <http://docs.python-requests.org/en/latest/>`_ to perform http requests. `Requests exceptions <http://docs.python-requests.org/en/latest/api/#requests.exceptions.RequestException>`_ won't be caught in case of connection error. Any :class:`~libnexmo.exceptions.NexmoError` subclass. """

        method = method.lower()

        if method not in ['get', 'post']:
            raise ValueError('The `method` parameter must be either `get` or `post`')

        response = requests.request(method, url, data=params)
        response_json = response.json()
        status = int(response_json['messages'][0]['status'])

        if status != 0:
            ErrorClass = status_to_error(status)
            error = response_json['messages'][0]['error-text']
            raise ErrorClass(error)

        return NexmoResponse(response_json)