'Send a request to the Wrike API
@param method: the HTTP method
@param path: the path relative to the repository URL
@param data: the data to send
@param auth: this is an authorization request'

def _send_request(self, method='GET', path=None, args=None, data=None, auth=False):

    repository = self.repository
    api = ('oauth2/token' if auth else 'api/v3')
    url = '/'.join((repository.url.rstrip('/'), api))
    if path:
        url = '/'.join((url, path.lstrip('/')))
    if args:
        url = '?'.join((url, urllib.urlencode(args)))
    req = urllib2.Request(url=url)
    handlers = []
    if (not auth):
        access_token = self.access_token
        if (not access_token):
            message = 'Authorization    failed:    no    access    token'
            current.log.error(message)
            return (None, message)
        req.add_header('Authorization', ('%s    %s' % (self.token_type, access_token)))
        request_data = (json.dumps(data) if data else '')
        if request_data:
            req.add_header('Content-Type', 'application/json')
    else:
        request_data = (urllib.urlencode(data) if data else '')
    req.add_header('Accept', 'application/json')
    config = repository.config
    proxy = (repository.proxy or config.proxy or None)
    if proxy:
        current.log.debug(('using    proxy=%s' % proxy))
        proxy_handler = urllib2.ProxyHandler({'https': proxy})
        handlers.append(proxy_handler)
    if handlers:
        opener = urllib2.build_opener(*handlers)
        urllib2.install_opener(opener)
    response = None
    message = None
    try:
        if (method == 'POST'):
            f = urllib2.urlopen(req, data=request_data)
        else:
            f = urllib2.urlopen(req)
    except urllib2.HTTPError as e:
        message = ('HTTP    %s:    %s' % (e.code, e.reason))
    else:
        try:
            response = json.load(f)
        except ValueError as e:
            message = sys.exc_info()[1]
    return (response, message)
