예제 #1
0
        public async System.Threading.Tasks.Task GetApplicationTestAsync()
        {
            ApplicationsClient client = new ApplicationsClient(httpClient);
            var apps = await client.GetAsync(cancellationToken);

            Assert.IsTrue(apps.StatusCode == 200);
            Assert.IsTrue(apps.Result.Count > 0);
        }
        static async Task Main(string[] args)
        {
            var httpClient = new HttpClient();

            httpClient.DefaultRequestHeaders.Add("Authorization", "[ACCESS_TOKEN]");
            var applicationsClient = new ApplicationsClient(httpClient);

            applicationsClient.BaseUrl = "https://[APP_NAME].azureiotcentral.com/api/preview";

            var result = await applicationsClient.GetAsync("ba038589-a29b-4466-a730-525657ff0bbe");

            string json = JsonConvert.SerializeObject(result, Formatting.Indented);

            Console.WriteLine(json);
        }