arthurai.client.validation.validate_response_status#

arthurai.client.validation.validate_response_status(response_or_code, expected_status_code=None, allow_redirects=False)#

Validate the status code of a requests.Response object or (int) status code. :type response_or_code: Union[Response, int] :param response_or_code: the requests.Response object or status code to validate :type expected_status_code: Optional[int] :param expected_status_code: the expected status code to check for. If None, all codes <300 will be valid, and 3XX codes will be subject to allow_redirects :type allow_redirects: Optional[bool] :param allow_redirects: if True will not raise an exception for 3XX status codes :rtype: None :return: None :raises InternalValueError: if expected_status_code is not None and does not match the response code :raises ResponseServerError: if the response has a 5XX status code :raises ResponseClientError: if the response has a 4XX status code :raises ResponseRedirectError: if the response has a 3XX status code