(relative_url, remote_details, linked_domain, params=None, method='get')
return response
:param relative_url: Relative URL on remote HQ
    :param remote_details: RemoteDetails object containing remote URL base and auth details
    :param linked_domain: Used for permission check on remote system
    :param params: GET/POST params to include
    :param method:
    :return:
:param relative_url: Relative URL on remote HQ
    :param remote_details: RemoteDetails object containing remote URL base and auth details
    :param linked_domain: Used for permission check on remote system
    :param params: GET/POST params to include
    :param method:
    :return:
: param relative_url : Relative URL on remote HQ : param remote_details : RemoteDetails object containing remote URL base and auth details : param linked_domain : Used for permission check on remote system : param params : GET / POST params to include : param method : : return :
def _do_request_to_remote_hq(relative_url, remote_details, linked_domain, params=None, method='get'):
    """
    :param relative_url: Relative URL on remote HQ
    :param remote_details: RemoteDetails object containing remote URL base and auth details
    :param linked_domain: Used for permission check on remote system
    :param params: GET/POST params to include
    :param method:
    :return:
    """
    url_base = remote_details.url_base
    username = remote_details.username
    api_key = remote_details.api_key
    full_url = '%s%s' % (url_base, relative_url)
    headers = {
        'HQ-REMOTE-REQUESTER': absolute_reverse('domain_homepage', args=[linked_domain])
    }
    try:
        response = requests.request(
            method, full_url,
            params=params, auth=ApiKeyAuth(username, api_key), headers=headers
        )
    except ConnectionError:
        notify_exception(None, "Error performing remote app request", details={
            'remote_url': full_url,
            'params': params,
            'headers': headers
        })
        raise RemoteRequestError()
    if response.status_code == 401:
        raise RemoteAuthError(response.status_code)
    elif response.status_code == 403:
        raise ActionNotPermitted(response.status_code)
    elif response.status_code != 200:
        notify_exception(None, "Error performing remote app request", details={
            'remote_url': full_url,
            'response_code': response.status_code,
            'params': params
        })
        raise RemoteRequestError(response.status_code)
    return response
def _do_request_to_remote_hq ( relative_url , remote_details , linked_domain , params = None , method = 'get' ) : url_base = remote_details . url_base username = remote_details . username api_key = remote_details . api_key full_url = '%s%s' % ( url_base , relative_url ) headers = { 'HQ-REMOTE-REQUESTER' : absolute_reverse ( 'domain_homepage' , args = [ linked_domain ] ) } try : response = requests . request ( method , full_url , params = params , auth = ApiKeyAuth ( username , api_key ) , headers = headers ) except ConnectionError : notify_exception ( None , "Error performing remote app request" , details = { 'remote_url' : full_url , 'params' : params , 'headers' : headers } ) raise RemoteRequestError ( ) if response . status_code == 401 : raise RemoteAuthError ( response . status_code ) elif response . status_code == 403 : raise ActionNotPermitted ( response . status_code ) elif response . status_code != 200 : notify_exception ( None , "Error performing remote app request" , details = { 'remote_url' : full_url , 'response_code' : response . status_code , 'params' : params } ) raise RemoteRequestError ( response . status_code ) return response