Particle.ParticleCloud.MakeGetRequestWithAuthTestAsync C# (CSharp) Method

MakeGetRequestWithAuthTestAsync() public method

Calls MakeGetRequestAsync(string) and if it returns a status code of Unauthorized try s to refresh the token and makes the request again
public MakeGetRequestWithAuthTestAsync ( String method ) : Task
method String The method to call
return Task
		public async Task<RequestResponse> MakeGetRequestWithAuthTestAsync(String method)
		{
			var result = await MakeGetRequestAsync(method);
			if (result.StatusCode == System.Net.HttpStatusCode.Unauthorized)
			{
				await RefreshTokenAsync();
				result = await MakeGetRequestAsync(method);
			}

			return result;
		}