def _request(self, method: str, path: str, params: Dict[(str, JSONLike)]=None, server: str=None, headers: dict=None, token: str=None, retry_on_api_error: bool=True) -> 'requests.models.Response':
    '\n        Runs any specified request (GET, POST, DELETE) against the server\n\n        Args:\n            - method (str): The type of request to be made (GET, POST, DELETE)\n            - path (str): Path of the API URL\n            - params (dict, optional): Parameters used for the request\n            - server (str, optional): The server to make requests against, base API\n                server is used if not specified\n            - headers (dict, optional): Headers to pass with the request\n            - token (str): an auth token. If not supplied, the `client.access_token` is used.\n            - retry_on_api_error (bool): whether the operation should be retried if the API returns\n                an API_ERROR code\n\n        Returns:\n            - requests.models.Response: The response returned from the request\n\n        Raises:\n            - ClientError: if the client token is not in the context (due to not being logged in)\n            - ValueError: if a method is specified outside of the accepted GET, POST, DELETE\n            - requests.HTTPError: if a status code is returned that is not `200` or `401`\n        '
    if (server is None):
        server = self.api_server
    assert isinstance(server, str)
    if (token is None):
        token = self.get_auth_token()
    import requests
    url = urljoin(server, path.lstrip('/')).rstrip('/')
    params = (params or {})
    headers = (headers or {})
    if token:
        headers['Authorization'] = 'Bearer {}'.format(token)
    headers['X-PREFECT-CORE-VERSION'] = str(prefect.__version__)
    if self._attached_headers:
        headers.update(self._attached_headers)
    session = requests.Session()
    retry_total = (6 if (prefect.config.backend == 'cloud') else 1)
    retries = requests.packages.urllib3.util.retry.Retry(total=retry_total, backoff_factor=1, status_forcelist=[500, 502, 503, 504], method_whitelist=['DELETE', 'GET', 'POST'])
    session.mount('https://', requests.adapters.HTTPAdapter(max_retries=retries))
    response = self._send_request(session=session, method=method, url=url, params=params, headers=headers)
    try:
        json_resp = response.json()
    except JSONDecodeError as exc:
        if ((prefect.config.backend == 'cloud') and ('Authorization' not in headers)):
            raise ClientError('Malformed response received from Cloud - please ensure that you have an API token properly configured.') from exc
        else:
            raise ClientError('Malformed response received from API.') from exc
    if (('API_ERROR' in str(json_resp.get('errors'))) and retry_on_api_error):
        (success, retry_count) = (False, 0)
        while ((success is False) and (retry_count < 6)):
            response = self._send_request(session=session, method=method, url=url, params=params, headers=headers)
            if ('API_ERROR' in str(response.json().get('errors'))):
                retry_count += 1
                time.sleep((0.25 * (2 ** (retry_count - 1))))
            else:
                success = True
    return response
Runs any specified request (GET, POST, DELETE) against the server

Args:
    - method (str): The type of request to be made (GET, POST, DELETE)
    - path (str): Path of the API URL
    - params (dict, optional): Parameters used for the request
    - server (str, optional): The server to make requests against, base API
        server is used if not specified
    - headers (dict, optional): Headers to pass with the request
    - token (str): an auth token. If not supplied, the `client.access_token` is used.
    - retry_on_api_error (bool): whether the operation should be retried if the API returns
        an API_ERROR code

Returns:
    - requests.models.Response: The response returned from the request

Raises:
    - ClientError: if the client token is not in the context (due to not being logged in)
    - ValueError: if a method is specified outside of the accepted GET, POST, DELETE
    - requests.HTTPError: if a status code is returned that is not `200` or `401`
def _request(self, method: str, path: str, params: Dict[(str, JSONLike)]=None, server: str=None, headers: dict=None, token: str=None, retry_on_api_error: bool=True) -> 'requests.models.Response':
    '\n        Runs any specified request (GET, POST, DELETE) against the server\n\n        Args:\n            - method (str): The type of request to be made (GET, POST, DELETE)\n            - path (str): Path of the API URL\n            - params (dict, optional): Parameters used for the request\n            - server (str, optional): The server to make requests against, base API\n                server is used if not specified\n            - headers (dict, optional): Headers to pass with the request\n            - token (str): an auth token. If not supplied, the `client.access_token` is used.\n            - retry_on_api_error (bool): whether the operation should be retried if the API returns\n                an API_ERROR code\n\n        Returns:\n            - requests.models.Response: The response returned from the request\n\n        Raises:\n            - ClientError: if the client token is not in the context (due to not being logged in)\n            - ValueError: if a method is specified outside of the accepted GET, POST, DELETE\n            - requests.HTTPError: if a status code is returned that is not `200` or `401`\n        '
    if (server is None):
        server = self.api_server
    assert isinstance(server, str)
    if (token is None):
        token = self.get_auth_token()
    import requests
    url = urljoin(server, path.lstrip('/')).rstrip('/')
    params = (params or {})
    headers = (headers or {})
    if token:
        headers['Authorization'] = 'Bearer {}'.format(token)
    headers['X-PREFECT-CORE-VERSION'] = str(prefect.__version__)
    if self._attached_headers:
        headers.update(self._attached_headers)
    session = requests.Session()
    retry_total = (6 if (prefect.config.backend == 'cloud') else 1)
    retries = requests.packages.urllib3.util.retry.Retry(total=retry_total, backoff_factor=1, status_forcelist=[500, 502, 503, 504], method_whitelist=['DELETE', 'GET', 'POST'])
    session.mount('https://', requests.adapters.HTTPAdapter(max_retries=retries))
    response = self._send_request(session=session, method=method, url=url, params=params, headers=headers)
    try:
        json_resp = response.json()
    except JSONDecodeError as exc:
        if ((prefect.config.backend == 'cloud') and ('Authorization' not in headers)):
            raise ClientError('Malformed response received from Cloud - please ensure that you have an API token properly configured.') from exc
        else:
            raise ClientError('Malformed response received from API.') from exc
    if (('API_ERROR' in str(json_resp.get('errors'))) and retry_on_api_error):
        (success, retry_count) = (False, 0)
        while ((success is False) and (retry_count < 6)):
            response = self._send_request(session=session, method=method, url=url, params=params, headers=headers)
            if ('API_ERROR' in str(response.json().get('errors'))):
                retry_count += 1
                time.sleep((0.25 * (2 ** (retry_count - 1))))
            else:
                success = True
    return response