private async Task PostExecute(HttpResponseMessage responseMessage)
        {
            if (_session.Settings.AfterResponse != null)
            {
                _session.Settings.AfterResponse(responseMessage);
            }

            if (!responseMessage.IsSuccessStatusCode)
            {
                throw await WebRequestException.CreateFromResponseMessageAsync(responseMessage);
            }
        }
Esempio n. 2
0
        private async Task PostExecute(HttpResponseMessage responseMessage)
        {
            _session.Settings.AfterResponse?.Invoke(responseMessage);
            if (_session.Settings.AfterResponseAsync != null)
            {
                await _session.Settings.AfterResponseAsync(responseMessage).ConfigureAwait(false);
            }

            if (!responseMessage.IsSuccessStatusCode)
            {
                throw await WebRequestException.CreateFromResponseMessageAsync(responseMessage, _session.Settings.WebRequestExceptionMessageSource).ConfigureAwait(false);
            }
        }