Esempio n. 1
0
        public ResponseWithHeaders <HttpRedirectsHead300Headers> Head300(CancellationToken cancellationToken = default)
        {
            using var message = CreateHead300Request();
            _pipeline.Send(message, cancellationToken);
            var headers = new HttpRedirectsHead300Headers(message.Response);

            switch (message.Response.Status)
            {
            case 200:
            case 300:
                return(ResponseWithHeaders.FromValue(headers, message.Response));

            default:
                throw _clientDiagnostics.CreateRequestFailedException(message.Response);
            }
        }
Esempio n. 2
0
        public async Task <ResponseWithHeaders <HttpRedirectsHead300Headers> > Head300Async(CancellationToken cancellationToken = default)
        {
            using var message = CreateHead300Request();
            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);

            var headers = new HttpRedirectsHead300Headers(message.Response);

            switch (message.Response.Status)
            {
            case 200:
            case 300:
                return(ResponseWithHeaders.FromValue(headers, message.Response));

            default:
                throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
            }
        }