Google.PowerShell.Common.AuthenticateWithSdkCredentialsExecutor.HandleResponseAsync C# (CSharp) 메소드

HandleResponseAsync() 공개 메소드

Handles an abnormal response when sending a HTTP request. A simple rule must be followed, if you modify the request object in a way that the abnormal response can be resolved, you must return true.
public HandleResponseAsync ( Google.Apis.Http.HandleUnsuccessfulResponseArgs args ) : Task
args Google.Apis.Http.HandleUnsuccessfulResponseArgs
리턴 Task
        public async Task<bool> HandleResponseAsync(HandleUnsuccessfulResponseArgs args)
        {
            if (args.Response.StatusCode == HttpStatusCode.Unauthorized)
            {
                return await RefreshTokenAsync(args.CancellationToken).ConfigureAwait(false);
            }

            return false;
        }