private void AssertResponseHasAcceptableStatus(HttpResponseMessage response, StatusAcceptability acceptableStatuses) { if (!acceptableStatuses.IsStatusAcceptable(response.StatusCode)) { throw new UnexpectedStatusException((int)response.StatusCode, string.Format( "{0} {1} -- expected response status to be {2}, got {3} ({4})\n\n\n{5}", response.RequestMessage.Method, response.RequestMessage.RequestUri.AbsoluteUri, acceptableStatuses.DescribeAcceptableStatuses(), (int)response.StatusCode, response.StatusCode, response.Content.ReadAsStringAsync().Result)); } }
private void AssertResponseHasAcceptableStatus(HttpResponseMessage response, StatusAcceptability acceptableStatuses) { if (!acceptableStatuses.IsStatusAcceptable(response.StatusCode)) { throw new UnexpectedStatusException((int)response.StatusCode, string.Format( "{0} {1} -- expected response status to be {2}, got {3} ({4})\n\n\n{5}", response.RequestMessage.Method, response.RequestMessage.RequestUri.AbsoluteUri, acceptableStatuses.DescribeAcceptableStatuses(), (int)response.StatusCode, response.StatusCode, response.Content.ReadAsStringAsync().Result)); } }