'Request a url.
Args:
url:
The web location we want to retrieve.
verb:
Either POST or GET.
data:
A dict of (str, unicode) key/value pairs.
Returns:
A JSON object.'

def _RequestUrl(self, url, verb, data=None):

    if (not self.__auth):
        raise TwitterError('The    twitter.Api    instance    must    be    authenticated.')
    if (url and self.sleep_on_rate_limit):
        limit = self.CheckRateLimit(url)
        if (limit.remaining == 0):
            try:
                time.sleep(int((limit.reset - time.time())))
            except ValueError:
                pass
    if (verb == 'POST'):
        if ('media_ids' in data):
            url = self._BuildUrl(url, extra_params={'media_ids': data['media_ids']})
        if ('media' in data):
            try:
                resp = requests.post(url, files=data, auth=self.__auth, timeout=self._timeout)
            except requests.RequestException as e:
                raise TwitterError(str(e))
        else:
            try:
                resp = requests.post(url, data=data, auth=self.__auth, timeout=self._timeout)
            except requests.RequestException as e:
                raise TwitterError(str(e))
    elif (verb == 'GET'):
        url = self._BuildUrl(url, extra_params=data)
        try:
            resp = requests.get(url, auth=self.__auth, timeout=self._timeout)
        except requests.RequestException as e:
            raise TwitterError(str(e))
    else:
        resp = 0
    if (url and self.sleep_on_rate_limit and self.rate_limit):
        limit = resp.headers.get('x-rate-limit-limit', 0)
        remaining = resp.headers.get('x-rate-limit-remaining', 0)
        reset = resp.headers.get('x-rate-limit-reset', 0)
        self.rate_limit.set_limit(url, limit, remaining, reset)
    return resp
