Esempio n. 1
0
        public static void EnsureStatus(this IRestResponse response, HttpStatusCode expected)
        {
            response.EnsureCompleted();

            if (response.StatusCode != expected)
            {
                throw new ApiException(
                          $"Response status code is not {(int)expected}. Status code: {(int)response.StatusCode} ({response.StatusDescription})",
                          response.Content);
            }
        }