Low-level request interface to mite. Takes a HTTP request scheme (lower
        case!), a URL to request (relative), and optionally data to add to the
        request. Either returns the JSON body of the request or raises a 
        HttpException.

def request(self, scheme, url, data=None, params=None):
        """
        Low-level request interface to mite. Takes a HTTP request scheme (lower
        case!), a URL to request (relative), and optionally data to add to the
        request. Either returns the JSON body of the request or raises a 
        HttpException.

        """
        url = self.url.format(self.team, url)
        headers = {
            "X-MiteApikey": self.api_key,
            "User-Agent":
                "mite Python wrapper: https://github.com/port-zero/mite",
            "Content-Type": "application/json",
        }
        # this is a nice little hack to make the API nicer
        # we pass the scheme as string, but have it as attributes in requests
        fn = requests.__getattribute__(scheme)

        res = fn(url, headers=headers, json=data, params=params)

        if res.status_code >= 300:
            self._raise_exception(res.status_code)

        if not res.content:
            return None

        try:
            return res.json()
        except ValueError:
            return res.content