'Returns token for the request.
host:
the service bus service request.
path:
the service bus service request.'

def _get_token(self, host, path, httpclient):

    wrap_scope = (((('http://' + host) + path) + self.issuer) + self.account_key)
    if (wrap_scope in _tokens):
        token = _tokens[wrap_scope]
        if (not self._token_is_expired(token)):
            return token
    request = HTTPRequest()
    request.protocol_override = 'https'
    request.host = host.replace('.servicebus.', '-sb.accesscontrol.')
    request.method = 'POST'
    request.path = '/WRAPv0.9'
    request.body = ((((('wrap_name=' + url_quote(self.issuer)) + '&wrap_password=') + url_quote(self.account_key)) + '&wrap_scope=') + url_quote((('http://' + host) + path))).encode('utf-8')
    request.headers.append(('Content-Length', str(len(request.body))))
    resp = httpclient.perform_request(request)
    token = resp.body.decode('utf-8-sig')
    token = url_unquote(token[(token.find('=') + 1):token.rfind('&')])
    _tokens[wrap_scope] = token
    return token
